Closed
Description
http://api.jquery.com/val/ contains:
For selects and checkboxes, you can also use the :selected and :checked selectors to get at values. For example:
// Get the value from a dropdown select
$( "select.foo option:selected").val();// Get the value from a dropdown select even easier
$( "select.foo" ).val();// Get the value from a checked checkbox
$( "input:checkbox:checked" ).val();// Get the value from a set of radio buttons
$( "input:radio[name=bar]:checked" ).val();
Since the example covers radio buttons, the description should read:
For selects, checkboxes and radio buttons, you can also use the :selected and :checked selectors to get at values.
Metadata
Metadata
Assignees
Labels
No labels