jQuery :enabled Selector

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

What You’ll Learn

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

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.

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.

📝 Syntax

Official jQuery API form (since 1.0):

jQuery
jQuery( ":enabled" )



// recommended — prefix with element type:

$( "input:enabled" )

$( "button:enabled" )

$( "#signupForm input:enabled" )

$( "select:enabled" )

Parameters

  • 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" );

⚡ Quick Reference

Control stateinput:enabledinput:disabled
Enabled input (no disabled attr)MatchesNo match
disabled attribute on inputNo matchMatches
Disabled via parent fieldsetNo match (live state)Matches
:not([disabled]) on fieldset childMay differ from :enabledAttribute vs property

📋 :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

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
Try It Yourself

How It Works

jQuery collects only inputs whose live disabled property is false, then sets .val() on that subset.

Example 2 — :enabled vs :not([disabled]) with Fieldset

Compare counts when a disabled fieldset disables child inputs without individual attributes.

jQuery
console.log( ":enabled →", $( "input:enabled" ).length );

console.log( ":not([disabled]) →", $( "input:not([disabled])" ).length );



// Fieldset-disabled input: not :enabled; may still match :not([disabled])
Try It Yourself

How It Works

Official jQuery docs note the subtle difference: :enabled reflects actual interactivity; :not([disabled]) only checks for the attribute in markup.

📈 Practical Patterns

Counts, styling, and collecting data from active fields.

Example 3 — Count Enabled Fields: $("#form input:enabled").length

Show how many inputs in a form are currently editable.

jQuery
var n = $( "#signupForm input:enabled" ).length;

$( "#enabledCount" ).text( n + " editable field(s)" );
Try It Yourself

How It Works

Scoped counting avoids scanning the whole document. Pair with :disabled for the locked subset.

Example 4 — Style Enabled Buttons: button:enabled

Add an active class to every clickable button for consistent UI styling.

jQuery
$( "button:enabled" ).addClass( "btn-active" );



// Disabled Submit stays unstyled — enabled buttons get btn-active
Try It Yourself

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
Try It Yourself

How It Works

Before submit or AJAX, iterate only :enabled inputs so locked fields never leak into the payload.

🚀 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.

📝 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.

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 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
:enabled Universal

Bottom line: Use input:enabled for scoped queries. Prefer :enabled over :not([disabled]) for live interactivity.

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.

💡 Best Practices

✅ Do

  • Use input:enabled or button:enabled
  • Scope to #formId input:enabled
  • Use :enabled for live interactivity checks
  • Pair with :disabled for full form state
  • Re-run selectors after disabling controls

❌ Don’t

  • Use bare $(":enabled") on large documents
  • Assume :not([disabled]) always equals :enabled
  • Apply :enabled to non-form elements
  • Forget fieldset inheritance when counting editable fields
  • Collect form data without filtering disabled fields

Key Takeaways

Knowledge Unlocked

Five things to remember about :enabled

Live enabled form controls only.

5
Core concepts
in 02

Prefix

input:enabled

Scope
off 03

vs disabled

Complement

Compare
not 04

vs :not()

Not [disabled]

Tip
demo 05

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.

Continue to :focus Selector

After enabled controls, learn how :focus matches the element that currently has keyboard or pointer focus.

:focus 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