IE7 issues with jQuery removeAttr method

I had used jQuery('#id').attr('readOnly', 'readOnly') set the readonly property of text box and used jQuery('#id').removeAttr('readOnly') to make the text box again but then found that "removeAttr" did not work in IE7, the textbox was still not editable.


Searching a bit found the .prop() jQuery method. Using jQuery('#id').prop('readOnly', null) resolved the IE7 issue.

Leave a Comment

Back to top