I need to find if a textbox is disabled or enabled using Jquery.
Use the disabled property to check if an element is disabled, e.g. if (element. disabled) {} . The disabled property returns true when the element is disabled, otherwise false is returned.
$('#dropDownId'). attr('disabled');
Learning jQuery So use the same attribute "readonly" to find out whether textbox is readonly or not using jQuery. $(document). ready(function(){ $("#txtReadonly"). attr('readonly', true); var isReadonly = $("#txtReadonly").
.prop('disabled')
will return a Boolean:
var isDisabled = $('textbox').prop('disabled');
Here's the fiddle: http://jsfiddle.net/unhjM/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With