Thank you very much. It's a good idear for this. I would like to know why the jQuery.attr doesn't work on this too...:) :) Thank you again.
On 2月13日, 下午10时13分, andrea varnier <[EMAIL PROTECTED]> wrote: > On 13 Feb, 12:23, 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 !! > > hi :) > you could use the replaceWith() method > like this > $("#changeType").replaceWith('<button>has changed</button>');- 隐藏被引用文字 - > > - 显示引用的文字 -