I have this HTML
<form>
<input type="text" id="text1" value="text1">
<input type="text" id="text2" value="text2" disabled>
<input type="text" id="text3" value="text3" readonly>
</form>
I want to add ui-state-disabled class to all disabled inputs, I use:
$('form input:disabled').addClass('ui-state-disabled');
However, text3 doesn’t get the class. How can I change my selector to include it? (Because readonly is the same as disabled in my application requirments)
You should add an attribute selector
DEMO