tags:

views:

81

answers:

3

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.

A: 

Check the documentation of jQuery

Selectors -> Select the right element Attributes -> Check what the value is

jitter
+3  A: 

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.

molf
A: 

You can use

$("#input_field").attr("disabled");

to see if the input_field is disabled

Paul Dixon