Reputation: 32321
I have a div as shown below. How to know if the location id is disabled or not ??
<div class="stTime fields">
<input id="location" type="text" placeholder="Label (Example Office , Home) " disabled="">
</div>
I have tried this way
var prop = $("#location").prop();
but i am getting Uncaught TypeError: Cannot read property 'nodeType' of undefined
in console
Upvotes: 1
Views: 88
Reputation: 1287
If you are using older versions of jQuery
var prop = $("#location").attr('disabled');
As of jQuery 1.6
, .prop()
has been introduced
var prop = $("#location").prop('disabled');
Upvotes: -1