开发者

How to replace input[type=submit] to input[type=text] using jQuery? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

jQuery chan开发者_运维技巧ge input type

How to replace input[type=submit] to input[type=text] using jQuery?

This way does't work:

$('input[type=submit]').removeAttr('type').attr('type','text');


You can't change that property type (don't know why but that is what firebug logs), so the best thing you can do is to totally remove the input-element and insert a new input with the correct type.

Use jQuery with something like this:

$('input[type=submit]').after("<input type='text' />");
$('input[type=submit]').remove();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜