The :input selector matches every form control — input, textarea, select, and button elements — in one expression. jQuery extension since 1.0; official demo counts controls versus form children.
01
Syntax
:input
02
Controls
4 tag types
03
Official
Count demo
04
.filter()
Performance
05
vs input
Tag only
06
Scope
form :input
Fundamentals
Introduction
Forms mix many control types — text fields, checkboxes, dropdowns, textareas, and buttons. When you need to style every control, disable a whole form, or count editable fields, listing each type separately is tedious. jQuery’s :input pseudo-class selects all form controls at once.
jQuery has supported :input since version 1.0. Official documentation states it selects all input, textarea, select, and button elements — basically every form control. Because it is a jQuery extension, prefer $("#form :input") or $("form *").filter(":input") over scanning the entire document with bare $(":input").
$("input") selects only input tags. $(":input") is wider — it includes textarea, select, and button too. Pick the narrowest selector that fits your task.
Foundation
📝 Syntax
Official jQuery API form (since 1.0):
jQuery
jQuery( ":input" )
// typical usage:
$( ":input" )
$( "form :input" )
$( "#signupForm :input" )
// performance pattern — CSS scope, then filter:
$( "form *" ).filter( ":input" )
// NOT the same as input tag selector:
$( "input" ) // input tags only
Parameters
None — :input takes no arguments. It always means form controls (input, textarea, select, button).
Return value
A jQuery object containing every matched form control in document order within the search scope.
Empty collection when no controls exist in scope.
Official jQuery API example
jQuery
var allInputs = $( ":input" );
var formChildren = $( "form > *" );
$( "#messages" ).text(
"Found " + allInputs.length + " inputs and the form has " +
formChildren.length + " children."
);
Cheat Sheet
⚡ Quick Reference
Selector
Matches
Notes
$(":input")
input, textarea, select, button
All controls
$("input")
input tags only
Narrower
$("form :input")
Controls in form
Scoped
$("form *").filter(":input")
Same controls
Performance
input:checkbox
One type
Not :input
Compare
📋 :input vs input tag, :text, and :button
Broad form controls vs tag selector vs type-specific pseudo-classes.
:input
form :input
All controls
input
form input
Input tags
:text
input:text
Text fields
:button
:button
Buttons only
Hands-On
Examples Gallery
Example 1 follows the official jQuery :input count demo. Examples 2–5 cover scoped .filter(":input"), comparison with the input tag, disabling all controls, and uniform styling.
📚 Official jQuery Demo
Count all form controls and compare to direct form children.
Example 1 — Official Demo: count :input
Official jQuery demo — report how many :input controls exist versus direct children of the form.
jQuery
var allInputs = $( ":input" );
var formChildren = $( "form > *" );
$( "#messages" ).text(
"Found " + allInputs.length + " inputs and the form has " +
formChildren.length + " children."
);
Text input, textarea, select, and button → full width in fieldset
Labels unchanged
How It Works
Scoped fieldset :input styles every control type without targeting labels or legends.
Applications
🚀 Common Use Cases
Form audit — count controls with $("form :input").length as in the official demo.
Read-only mode — .prop("disabled", true) on all :input in a form.
Uniform styling — one CSS pass for inputs, textareas, selects, and buttons.
Validation setup — attach handlers to every control in a wizard step.
Reset helpers — iterate form :input to clear values (with type checks).
Performance — $("#form *").filter(":input") instead of document-wide scans.
🧠 How jQuery Evaluates :input
1
Build candidate set
Evaluate prefix — bare :input, form :input, or filtered descendants.
Query
2
Test tag name
Keep elements whose node name is input, textarea, select, or button.
Filter
3
Include all types
Every input type counts — text, hidden, checkbox, file, button, etc.
Union
4
✓
Return collection
Chain .prop(), .css(), .on(), or read .length.
Important
📝 Notes
Available since jQuery 1.0 — jQuery extension, not native CSS.
Matches input, textarea, select, and button — all form controls.
Not the same as $("input") — tag selector is narrower.
Prefer scoped queries — form :input or .filter(":input").
Does not match option elements unless they are also inputs (they are not).
Pair with :enabled, :disabled, or :checked for state filters.
Compatibility
Browser Support
The :input pseudo-class is a jQuery extension and works in jQuery 1.0+. Form controls themselves are universal in modern browsers. Scope with CSS first, then .filter(":input") when performance matters.
✓ jQuery 1.0+ · extension
jQuery :input Selector
All form controls — input, textarea, select, and button.
100%jQuery + HTML
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
:inputUniversal
Bottom line: Scope to your form — avoid bare $(':input') on huge documents.
Wrap Up
Conclusion
The :input selector matches every form control — input, textarea, select, and button. The official demo counts :input elements and compares that total to direct form children.
Use it for broad form operations, distinguish it from the input tag selector, and prefer scoped .filter(":input") on large pages.
Use :input in native CSS stylesheets — jQuery-only
Disable labels when disabling :input — labels stay active
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about :input
Every form control in one selector.
5
Core concepts
📝01
:input
All controls
API
402
Tags
in+ta+sel+btn
Rule
.filter03
Scope
Performance
Tip
demo04
Official
Count
Demo
≠05
input tag
Narrower
Compare
❓ Frequently Asked Questions
:input selects every form control — input, textarea, select, and button elements. It is the broadest jQuery form pseudo-class for gathering editable and submittable controls. Available since jQuery 1.0.
No. $("input") matches only input tags. $(":input") also includes textarea, select, and button elements. Official docs describe :input as selecting all form controls.
No. It is a jQuery extension since version 1.0. Native querySelectorAll cannot run :input directly. Scope with a form selector, then use .filter(":input") as official docs recommend for performance.
:text, :checkbox, :file, and similar pseudo-classes match one input type. :input matches every form control type at once — inputs, textareas, selects, and buttons.
Official jQuery demo runs var allInputs = $(":input") and compares .length to $("form > *").length — showing how many form controls exist versus direct form children (which may include labels and fieldsets).
Prefer scoping — $("#myForm :input") or $("form *").filter(":input"). Bare $(":input") scans the entire document and is slower on large pages.
Did you know?
jQuery provides many narrower form pseudo-classes — :text, :password, :radio, :checkbox, :submit, and more. Use :input when you need every control at once; use type-specific selectors when you only care about one kind.