开发者

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

开发者 https://www.devze.com 2023-01-22 16:38 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: jQuery chan开发者_运维技巧ge input type
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

精彩评论

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