Thank you for your reply. And I have testing on IE7 and Firefox2.0.x , and when I using code: document.getElementById("changeType").setAttribute("type","button"); can change the type when the element has created... so,I think maybe IE and Firefox can support on the change when the element has created. Do you think so ?
On 2月14日, 上午5时07分, "Karl Rudd" <[EMAIL PROTECTED]> wrote: > You'd be better off making a new "button" and copying the attributes > across. Certain browsers *cough* IE 6 *cough* don't allow you to > change the type of a "input" once it's created. > > Karl Rudd > > On Feb 13, 2008 10:23 PM, wwwiori <[EMAIL PROTECTED]> wrote: > > > > > > > Dear Team, > > I have a question that how can I modify the attribute using jQuery. > > For example: > > There have a element: > > <input id="changeType" type="checkbox" value="has changed"> > > and now I would like to change the type to "button", following code is > > my tried on IE7 and Firefox 2.02 on jQuery 1.2.3 and there are not > > success: > > 1. > > $("#changeType").attr("type","button"); //failed > > > 2. > > $("#changeType").removeAttr("type"); > > $("#changeType").attr("type","button"); //failed > > > I can modify the type by following code: > > > document.getElementById("changeType").setAttribute("type","button"); > > So,How can i do this by jQuery ? Thanks in advance for your gread > > help !!- 隐藏被引用文字 - > > - 显示引用的文字 -