ExampleSelect the pre-selected item(s) in a drop-down list:
Try it yourself » |
The :selected selector selects option elements that are pre-selected.
$(":selected") |
Note: This selector will not work on checkboxes or radio buttons. Use
:checked for instead.