The :enabled selector matches form elements that are currently enabled — interactive and editable by the user. Available since jQuery 1.0; it is the complement of :disabled.
01
Syntax
input:enabled
02
Live
Actual state
03
Official
input:enabled
04
vs :disabled
Complement
05
vs :not()
Not [disabled]
06
Scope
Not bare :enabled
Fundamentals
Introduction
Most form workflows need to target controls the user can actually interact with — editable text fields, clickable buttons, and selectable options. jQuery’s :enabled pseudo-class selects those elements in one pass.
Official jQuery documentation recommends prefixing with a tag or scoped selector — $("input:enabled") instead of bare $(":enabled"), which implies $("*:enabled") and scans every element type. Although results are usually similar, :enabled is subtly different from :not([disabled]) when fieldsets or dynamic state are involved.
Concept
Understanding the :enabled Selector
Think of :enabled as a live filter on form controls:
<input type="text"> → matches input:enabled.
<input disabled> → no match for :enabled.
Input inside a disabled <fieldset> → no match (inherits disabled state).
button:enabled, select:enabled, textarea:enabled — same pattern.
💡
Beginner Tip
To change enabled state, use .prop("disabled", true/false). Use :enabled to find controls that are already editable — then read values, style, or validate them.
No arguments — filters by current enabled DOM state (disabled property strictly false).
Return value
A jQuery object containing every enabled element in the search context.
Empty collection when nothing is enabled in scope.
Official jQuery API example
jQuery
// Finds all input elements that are enabled
$( "input:enabled" ).val( "this is it" );
Cheat Sheet
⚡ Quick Reference
Control state
input:enabled
input:disabled
Enabled input (no disabled attr)
Matches
No match
disabled attribute on input
No match
Matches
Disabled via parent fieldset
No match (live state)
Matches
:not([disabled]) on fieldset child
May differ from :enabled
Attribute vs property
Compare
📋 :enabled vs :disabled and :not([disabled])
State pseudo-class vs complement and attribute negation.
:enabled
input:enabled
disabled property false
:disabled
input:disabled
Actually disabled now
:not([disabled])
input:not([disabled])
No disabled attribute
.prop()
.prop("disabled", false)
Enable control
Hands-On
Examples Gallery
Example 1 follows the official jQuery input:enabled demo. Examples 2–5 compare with :not([disabled]), count enabled fields, style buttons, and collect values from editable inputs only. Use the Try-it links to run each snippet.
📚 Official jQuery Demo
Target enabled inputs only — disabled fields are skipped.
Example 1 — Official Demo: input:enabled
Official jQuery demo — set the value on every enabled input.
jQuery
$( "input:enabled" ).val( "this is it" );
// Only enabled inputs change — disabled inputs keep their values
Submit and Cancel → btn-active class
Disabled Locked button → unchanged
How It Works
:enabled works on button, not just input. Official docs list all supported element types.
Example 5 — Collect Values: $("#form input:enabled").each()
Build a data object from editable fields only — skip disabled secrets.
jQuery
var data = {};
$( "#profileForm input:enabled" ).each( function() {
data[ $( this ).attr( "name" ) ] = $( this ).val();
});
console.log( data ); // user and email only — secret skipped
{ user: "alex", email: "alex@example.com" }
Disabled "secret" field excluded
How It Works
Before submit or AJAX, iterate only :enabled inputs so locked fields never leak into the payload.
Applications
🚀 Common Use Cases
Form validation — validate only input:enabled fields the user can edit.
Submit gating — enable styling on button:enabled when the form is ready.
Wizard steps — collect values from the active step’s enabled controls.
Bulk disable — after locking the form, verify :enabled returns empty.
Accessibility audit — list controls that should be enabled but are not.
Compare state — verify :enabled vs :not([disabled]) after dynamic updates.
🧠 How jQuery Evaluates :enabled
1
Find candidates
Start from scoped inputs — input:enabled, not bare :enabled.
Scope
2
Read property
Test the live disabled property — must be strictly false.
DOM
3
Filter enabled
Keep only elements that are interactive right now.
State
4
✓
Return collection
Matching elements become a jQuery object for chaining.
Important
📝 Notes
Available since jQuery 1.0 — matches current enabled state.
Use on button, input, select, textarea, optgroup, option, fieldset, menuitem only.
Prefer input:enabled over bare $(":enabled") (implies *:enabled).
:enabled vs :not([disabled]) — live property vs attribute absence (official docs).
Complement of :disabled on the same element types.
Re-query after toggling — the matched set changes when controls are disabled.
Compatibility
Browser Support
The :enabled pseudo-class is part of CSS3 for form controls and works in jQuery 1.0+. Modern browsers support document.querySelectorAll("input:enabled"). jQuery evaluates live enabled state consistently, excluding fieldset-disabled descendants.
✓ CSS3 · jQuery 1.0+
jQuery :enabled Selector
Supported in all modern browsers. Native: querySelectorAll("input:enabled"). 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
:enabledUniversal
Bottom line: Use input:enabled for scoped queries. Prefer :enabled over :not([disabled]) for live interactivity.
Wrap Up
Conclusion
The :enabled selector matches form elements that are interactive right now — whose disabled property is strictly false. The official input:enabled demo shows how to target that subset for chaining methods like .val().
Prefix with an element type, distinguish from :not([disabled]), and pair with :disabled when you need both sides of form state.
Forget fieldset inheritance when counting editable fields
Collect form data without filtering disabled fields
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about :enabled
Live enabled form controls only.
5
Core concepts
on01
:enabled
Live state
API
in02
Prefix
input:enabled
Scope
off03
vs disabled
Complement
Compare
not04
vs :not()
Not [disabled]
Tip
demo05
Official
.val() demo
Demo
❓ Frequently Asked Questions
:enabled matches form elements that are currently enabled — interactive and editable by the user. $("input:enabled") finds every enabled input in the search context. Available since jQuery 1.0.
Official jQuery docs: although results are usually similar, :enabled selects elements whose disabled property is strictly false, while :not([disabled]) selects elements without a disabled attribute in the markup (regardless of value). A field inside a disabled fieldset may not match :not([disabled]) but still fail :enabled.
Bare :enabled implies the universal selector — equivalent to $("*:enabled"), which scans every element type. Prefer $("input:enabled"), $("button:enabled"), or $("#form :enabled") for clarity and performance.
Official docs: use :enabled only on elements that support the disabled attribute — button, input, select, textarea, optgroup, option, fieldset, and menuitem.
They are complementary state filters on the same element types. An input is either enabled or disabled at any moment — use :enabled to target editable controls and :disabled for locked ones.
:enabled 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:enabled") excludes those fields, while $("input:not([disabled])") may still include them — one reason jQuery documents :enabled as the better state selector.