I want to throw an alert when an input has a \'readonly\' attribute. I have tried this:
if($(\'input\').attr(\'readonly\') == \'readonly\'){ alert(\"foo\"
try this:
if($('input').attr('readonly') == undefined){ alert("foo"); }
if it is not there it will be undefined in js
undefined