Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

jQuery :selected Selector

❮ jQuery Selectors

Example

Select the pre-selected item(s) in a drop-down list:

$(":selected")
Try it Yourself »

Definition and Usage

The :selected selector selects option elements that are pre-selected.

Note: This selector will not work on checkboxes or radio buttons. Use the :checked selector instead.


Syntax

$(":selected")

❮ jQuery Selectors