This is my code inside document.ready:
var $inputs = mySelectors(); $inputs.each(function() { $(this).attr("readonly", "true"); });
This code works for IE8, but not for FF3.5
IE output (as shown in the IE Developer toolbar) <input type="text" readOnly="readonly"..../>
FF output (with Firebug) <input type="text" readonly="">
What is the correct way to install it?
$elem.attr("readonly","true");
or
$elem.attr("readonly","readonly");
or
$elem.attr("readOnly","readonly");
It seems like there was an old mistake, but not sure if it was resolved. http://osdir.com/ml/jquery-dev/2009-05/msg00115.html
link: http://api.jquery.com/attr/
Browser Compatibility: Some attributes have inconsistent naming from browser to browser. Moreover, the values ββof some attributes were reported inconsistently by browsers and even in versions of a single browser. The .attr () method reduces such inconsistencies.
Is there a way to overcome this inconsistency between browsers?
source share