Skip to content

.val() documentation should mention radio buttons #981

Closed
@Chealer

Description

@Chealer

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions