If have an element that maybe disabled on a page, and would like to check it's value before I do something.
How is this done?
Thanks in advance.
If have an element that maybe disabled on a page, and would like to check it's value before I do something.
How is this done?
Thanks in advance.
Check the documentation of jQuery
Selectors -> Select the right element Attributes -> Check what the value is
If your HTML looks something like this:
<input id="my_input_field" value="my value" type="text" disabled="disabled"/>
Then you can use the following jQuery to retrieve the value:
$("#my_input_field").val();
See the jQuery documentation to find out in what way you can access elements in the HTML document.
You can use
$("#input_field").attr("disabled");
to see if the input_field is disabled