1

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.

1
  • ? Be more clear what kind of an element Commented Jun 26, 2009 at 10:12

3 Answers 3

3

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.

Sign up to request clarification or add additional context in comments.

Comments

0

Check the documentation of jQuery

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

Comments

0

You can use

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

to see if the input_field is disabled

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.