How to replace input[type=submit] to input[type=text] using jQuery? [duplicate]
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();
精彩评论