O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting Elements by Form Status

$("input:checked");   //selects <input> elements that are checked $("option:selected");   //selects <option> elements that are selected $("#myForm :focus");   //selects the element in the #myForm <form>   //that currently has the focus $("input:disabled");   //selects <input> elements that are currently disabled

An extremely useful set of selectors when working with dynamic HTML forms is the form jQuery selectors. These selectors allow you to select elements in the form based on the state of the form element. Table 4.5 shows some examples of form selectors.

Image

Table 4.5 Examples ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required