The :disabled selector matches form elements that are currently disabled — not editable or clickable by the user. Available since jQuery 1.0; pair with :enabled and use .prop("disabled") to change state.
01
Syntax
input:disabled
02
Live
Actual state
03
Official
input:disabled
04
vs [disabled]
Attribute
05
.prop()
Toggle
06
Scope
Not bare :disabled
Fundamentals
Introduction
Disabled form controls cannot receive focus or user input — browsers gray them out and skip them on submit (with exceptions for disabled fields that still serialize in some cases). The HTML disabled attribute sets initial state; JavaScript can also toggle disability via the DOM property.
jQuery’s :disabled pseudo-class selects elements that are disabled right now. Official documentation recommends prefixing with a tag or scoped selector — $("input:disabled") instead of bare $(":disabled"), which implies $("*:disabled") and scans every element type.
Concept
Understanding the :disabled Selector
Think of :disabled as a live filter on form controls:
<input disabled> → matches input:disabled.
Enabled input → no match for :disabled.
Input inside a disabled <fieldset> → matches :disabled even without its own attribute.
button:disabled, select:disabled, textarea:disabled — same pattern.
💡
Beginner Tip
To change disabled state, use .prop("disabled", true/false). Use :disabled to find controls that are already disabled — then style, count, or enable them.
No arguments — filters by current disabled DOM state.
Return value
A jQuery object containing every disabled element in the search context.
Empty collection when nothing is disabled.
Official jQuery API example
jQuery
// Finds all input elements that are disabled
$( "input:disabled" ).val( "this is it" );
Cheat Sheet
⚡ Quick Reference
Control state
input:disabled
input[disabled]
disabled attribute on input
Matches
Matches
Enabled input
No match
No match (no attribute)
Disabled via parent fieldset
Matches (live state)
May not match (no attribute on input)
Attribute present but .prop(false)
No match (live state)
May still match attribute
Compare
📋 :disabled vs [disabled] and :enabled
State pseudo-class vs attribute selector — and the opposite filter.
:disabled
input:disabled
Actually disabled now
[disabled]
input[disabled]
Attribute exists
:enabled
input:enabled
Not disabled
.prop()
.prop("disabled", true)
Set state
Hands-On
Examples Gallery
Example 1 follows the official jQuery input:disabled demo. Examples 2–5 compare with [disabled], count disabled fields, style buttons, and re-enable controls with .prop(). Use the Try-it links to run each snippet.
📚 Official jQuery Demo
Target disabled inputs only — enabled fields are skipped.
Example 1 — Official Demo: input:disabled
Official jQuery demo — set the value on every disabled input.
jQuery
$( "input:disabled" ).val( "this is it" );
// Only disabled inputs change — enabled inputs keep their values
After .prop("disabled", false), those inputs no longer match :disabled — live state drives the selector.
Applications
🚀 Common Use Cases
Form validation — count or highlight input:disabled vs editable fields.
Submit gating — style button:disabled until the form is valid.
Wizard steps — disable fields in inactive steps; query with scoped :disabled.
Bulk unlock — select disabled set, then .prop("disabled", false).
Accessibility audit — list controls that are disabled unexpectedly.
Compare state — verify :disabled vs [disabled] after dynamic updates.
🧠 How jQuery Evaluates :disabled
1
Find candidates
Start from scoped inputs — input:disabled, not bare :disabled.
Scope
2
Read property
Test the live disabled property — includes fieldset inheritance.
DOM
3
Filter disabled
Keep only elements that are non-interactive right now.
State
4
✓
Return collection
Matching elements become a jQuery object for chaining.
Important
📝 Notes
Available since jQuery 1.0 — matches current disabled state.
Use on button, input, select, textarea, optgroup, option, fieldset, menuitem only.
Prefer input:disabled over bare $(":disabled") (implies *:disabled).
:disabled vs [disabled] — live property vs attribute presence (official docs).
Use .prop("disabled") to read or set state — not .attr("disabled").
Re-query after toggling — the matched set changes when controls are enabled.
Compatibility
Browser Support
The :disabled pseudo-class is part of CSS3 for form controls and works in jQuery 1.0+. Modern browsers support document.querySelectorAll("input:disabled"). jQuery evaluates live disabled state consistently, including fieldset-disabled descendants.
✓ CSS3 · jQuery 1.0+
jQuery :disabled Selector
Supported in all modern browsers. Native: querySelectorAll("input:disabled"). Reflects live disabled property.
100%Standard + jQuery
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
:disabledUniversal
Bottom line: Use input:disabled for scoped queries. Pair with .prop() to toggle state, not .attr().
Wrap Up
Conclusion
The :disabled selector matches form elements that are disabled right now — not merely those with a disabled attribute in the HTML source. The official input:disabled demo shows how to target that subset for chaining methods like .val().
Prefix with an element type, distinguish from [disabled], and use .prop("disabled") when you need to change state rather than select elements.
Assume [disabled] and :disabled always match the same set
Forget fieldset inheritance when counting disabled fields
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about :disabled
Live disabled form controls only.
5
Core concepts
off01
:disabled
Live state
API
in02
Prefix
input:disabled
Scope
[]03
vs attr
Not [disabled]
Compare
.prop04
Toggle
Not .attr
Tip
demo05
Official
.val() demo
Demo
❓ Frequently Asked Questions
:disabled matches form elements that are currently disabled — not interactive and typically grayed out by the browser. $("input:disabled") finds every disabled input in the search context. Available since jQuery 1.0.
Official jQuery docs: although results are often similar, :disabled matches elements that are actually disabled while [disabled] only checks whether the disabled attribute exists in the markup. A field inside a disabled fieldset may match :disabled without having its own disabled attribute.
Bare :disabled implies the universal selector — equivalent to $("*:disabled"), which scans every element type. Prefer $("input:disabled"), $("button:disabled"), or $("#form :disabled") for clarity and performance.
Official docs: use :disabled only on elements that support the disabled attribute — button, input, select, textarea, optgroup, option, fieldset, and menuitem.
Use .prop("disabled", true) or .prop("disabled", false) to change state. Use :disabled to find elements that are already disabled. Official docs recommend .prop over .attr for boolean form properties.
:disabled is standard CSS3 for form controls and works in modern querySelectorAll when prefixed with an element type. jQuery has supported it since 1.0.
Did you know?
Disabling a <fieldset> disables all its form controls without adding disabled to each input. $("input:disabled") catches those fields; $("input[disabled]") may miss them — one reason jQuery documents :disabled as the better state selector.