jQuery :selected Selector

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Select options

What You’ll Learn

The :selected selector matches every selected <option> inside a <select> dropdown. Available since jQuery 1.0; does not apply to checkboxes or radios — use :checked for those.

01

Syntax

option:selected

02

select

Dropdowns

03

Official

change demo

04

vs :checked

Options only

05

.val()

Read value

06

.filter()

Performance

Introduction

Dropdown menus, country pickers, and category filters all use <select> elements with nested <option> tags. When a user picks an item, that option becomes the selected one. jQuery’s :selected pseudo-class finds every option currently highlighted in the list.

Official jQuery documentation notes that :selected works for option elements only — not checkboxes or radio inputs. For those, use :checked instead. The official demo binds change on a select, loops option:selected, and writes the combined text to a div.

Understanding the :selected Selector

Think of :selected as “which options are picked in my dropdown?”:

  • select option:selected → the active option(s) in that list.
  • Single <select> → usually one option:selected.
  • <select multiple> → can match several options at once.
  • input:checkbox:checked → different control — use :checked, not :selected.
💡
Beginner Tip

For a quick value read, $("#mySelect").val() is often enough. Reach for option:selected when you need the visible label text or want to loop multiple selections.

📝 Syntax

Official jQuery API form (since 1.0):

jQuery
jQuery( ":selected" )

// recommended — scope to options:
$( "select option:selected" )
$( "#mySelect option:selected" )

// read value (common shortcut):
$( "#mySelect" ).val()

// performance pattern (official docs):
$( "#mySelect option" ).filter( ":selected" )

// not for checkboxes — use :checked instead:
$( "input:checked" )

Parameters

  • No arguments — keeps option elements that are currently selected.

Return value

  • A jQuery object containing every selected option (one or more for multi-select).

Official jQuery API example

jQuery
$( "select" )
  .on( "change", function() {
    var str = "";
    $( "select option:selected" ).each( function() {
      str += $( this ).text() + " ";
    } );
    $( "div" ).text( str );
  } )
  .trigger( "change" );

⚡ Quick Reference

Controloption:selected:checked
<select><option>Matches selected optionAlso matches (standard CSS)
<input type="checkbox">No matchMatches when ticked
<input type="radio">No matchMatches when chosen
$("#s").val()Gets value directlyN/A for select
.filter(":selected")Official perf tipSame pattern for :checked

📋 :selected vs :checked

Dropdown options vs checkbox and radio state.

:selected
option:selected

Select options only

:checked
input:checked

Checkbox / radio

.val()
$("#s").val()

Quick value read

.filter()
option.filter(":selected")

Performance tip

Examples Gallery

Example 1 follows the official jQuery select option:selected change demo. Examples 2–5 cover reading values, contrast with :checked, multi-select, and the .filter performance pattern.

📚 Official jQuery Demo

Show selected option text on every change.

Example 1 — Official Demo: option:selected on Change

Official jQuery demo — collect selected option text and trigger initial draw.

jQuery
$( "select" )
  .on( "change", function() {
    var str = "";
    $( "select option:selected" ).each( function() {
      str += $( this ).text() + " ";
    } );
    $( "div" ).text( str );
  } )
  .trigger( "change" );
Try It Yourself

How It Works

.trigger("change") runs the handler once on load so the div reflects the default selection immediately.

Example 2 — Read Value and Label

Get both the submitted value and the visible option text.

jQuery
$( "#category" ).on( "change", function() {
  var val = $( this ).val();
  var label = $( "#category option:selected" ).text();
  $( "#out" ).text( "Value: " + val + " | Label: " + label );
} );
Try It Yourself

How It Works

.val() on the select returns the value attribute; option:selected gives access to the human-readable label.

📈 Practical Patterns

Checked contrast, multi-select, and performance filtering.

Example 3 — option:selected vs input:checked

Official docs — :selected for dropdowns; :checked for checkboxes and radios.

jQuery
console.log( "Selected options:", $( "option:selected" ).length );
console.log( "Checked inputs:", $( "input:checked" ).length );

// :selected → select options only
// :checked → checkboxes, radios, and options
Try It Yourself

How It Works

Mixing them up causes empty results — checkboxes never match option:selected.

Example 4 — Multi-Select: Several option:selected

When multiple is set, loop every highlighted option.

jQuery
$( "#tags" ).on( "change", function() {
  var picked = [];
  $( "#tags option:selected" ).each( function() {
    picked.push( $( this ).val() );
  } );
  $( "#out" ).text( picked.join( ", " ) );
} );
Try It Yourself

How It Works

Hold Ctrl/Cmd to select multiple items — option:selected returns each active row.

Example 5 — Performance: .filter(":selected")

Official docs — select options with CSS first, then filter by state.

jQuery
var selected = $( "#mySelect option" ).filter( ":selected" );

// equivalent to:
// $( "#mySelect option:selected" )

selected.each( function() {
  console.log( $( this ).text() );
} );
Try It Yourself

How It Works

Because :selected is a jQuery extension, scoping with a tag selector first avoids a universal scan.

🚀 Common Use Cases

  • Category filters — react to option:selected on change.
  • Shipping forms — read country/state from selected option value.
  • Dynamic UI — show panels based on dropdown selection text.
  • Multi-tag pickers — collect all option:selected values into an array.
  • Validation — require a non-empty option:selected before submit.
  • Analytics — log label text from option:selected on user change.

🧠 How jQuery Evaluates :selected

1

Parse selector

Combine option with :selected — or filter after a CSS query.

Query
2

Find options

Collect option elements in scope (inside matching selects).

Scan
3

Filter by state

Keep options whose selected property is true in the live DOM.

Match
4

Return collection

Chain .text(), .val(), or .each() on the result.

📝 Notes

  • Available since jQuery 1.0 — for option elements in select controls.
  • Does not match checkboxes or radio inputs — use :checked (official docs).
  • jQuery extension — prefer option prefix or .filter(":selected").
  • Single select usually returns one option; multiple can return several.
  • $("#select").val() is a convenient shortcut for the selected value.
  • Bind change on the select, not individual options, for user picks.

Browser Support

The :selected pseudo-class is a jQuery extension and works in jQuery 1.0+. Selected state on options is standard DOM behavior in all browsers; use .filter(":selected") after a CSS option query as jQuery docs recommend.

jQuery 1.0+ · extension

jQuery :selected Selector

Select dropdown options — not checkboxes or radios.

100% jQuery + DOM options
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
:selected Universal

Bottom line: Use option:selected for dropdowns; use :checked for checkbox and radio state.

Conclusion

The :selected selector matches every currently selected option in a dropdown — the official demo loops them on change and displays their text.

Use it for <select> menus; reach for :checked when you need checkbox or radio state instead.

💡 Best Practices

✅ Do

  • Write $("#s option:selected") for scoped queries
  • Use :checked for checkboxes and radios
  • Bind change on the select element
  • Use .filter(":selected") for performance (official tip)
  • Call .trigger("change") to sync initial UI state

❌ Don’t

  • Use :selected on checkbox inputs
  • Expect bare $(":selected") to be fast on huge pages
  • Confuse :selected with :checked semantics
  • Forget multiple selects can yield several matches
  • Read options before the DOM is ready

Key Takeaways

Knowledge Unlocked

Five things to remember about :selected

Dropdown options only.

5
Core concepts
02

:checked

Not same

Rule
val 03

.val()

Shortcut

Tip
multi 04

Multiple

Many OK

Compare
demo 05

Official

change

Demo

❓ Frequently Asked Questions

:selected matches every option element that is currently selected inside a select dropdown. Official jQuery docs: it works for option elements in select controls. Available since jQuery 1.0.
No. Official jQuery docs state that :selected does not work for checkboxes or radio inputs — use :checked for those control types instead.
:selected targets selected option elements in a select. :checked matches ticked checkboxes, selected radios, and can also match options. Use option:selected when you only care about dropdown selections.
Bind change on select, loop $("select option:selected").each() to collect option text, write it to a div, then .trigger("change") for the initial draw — exactly as in the jQuery API docs.
Use $("#mySelect").val() for the value, or $("#mySelect option:selected").text() for visible label text. Both read the current selection after the user changes the dropdown.
Because :selected is a jQuery extension, first select options with a CSS selector then narrow with .filter(":selected") — for example $("#mySelect option").filter(":selected").
Did you know?

The official jQuery :selected demo calls .trigger("change") immediately after binding the handler so the output div shows the default option text on page load — not only after the user picks a new item. That one line saves a duplicate “draw initial state” function.

Continue to :disabled Selector

After reading selected dropdown options, learn how :disabled matches locked form controls.

:disabled selector tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful