:input (since jQuery 1.0) selects every form control — input, textarea, select, and button. It is broader than $("input"), which matches only <input> tags. Scope to a form when you can; on large pages prefer $("form *").filter(":input").
Remember
$(":input") // all form controls
$("form :input") // controls inside a form
$("form *").filter(":input") // official performance pattern
$("input") // <input> tags only — narrower!
// Avoid on large pages:
$(":input") // whole-document scan
Scope to a form, then count, disable, serialize, or style every control.
Prefer $("form :input") over bare $(":input") on large pages.
Remember it includes textarea, select, and button — not just input.
For speed: $("#form *").filter(":input") (official tip).
Use type-specific selectors (:text, :checkbox, …) when you need one kind only.
Compare with $("form > *") when labels/fieldsets sit as direct children.
Piece
Required?
Role
Selector string
Yes
:input filter (best scoped to a form)
Form / context
Recommended
Avoids controls in unrelated widgets
.filter(":input")
Optional
Official pattern after a pure CSS query
Return value
—
jQuery collection of form controls (may be empty)
Pseudocode
Pseudocode
matches = []
for each element in search context:
if element.tag is input
or element.tag is textarea
or element.tag is select
or element.tag is button:
matches.add(element)
return matches
// Faster pattern:
candidates = querySelectorAll("form *")
return filter candidates with :input rules
Reference
Cheat Sheet
Keep these facts handy while selecting form controls.
Topic
Detail
Syntax
$(":input") / $("form :input")
Since
jQuery 1.0 · jQuery extension
Matches
input, textarea, select, button
vs $("input")
Tag only — misses textarea/select/button
vs type filters
:text, :checkbox, … are narrower
Speed tip
$("form *").filter(":input")
Official demo
Compare :input count vs form > *
Native CSS
No — use CSS + .filter()
Try it
Live Preview
Run different selectors against a small sample form and see how many controls match.
Sample markup mirrors the official jQuery form demo (label+text, textarea, select, checkbox, button).
Short, copy-ready snippets. Open DevTools Console with jQuery loaded, or use Try It Yourself for a live editor.
Example 1 — Official Demo: Count :input
Compare form-control count with direct form children (jQuery API example).
jQuery
var allInputs = $(":input");
var formChildren = $("form > *");
$("#messages").text(
"Found " + allInputs.length + " inputs and the form has " +
formChildren.length + " children."
);
Context.#signup :input searches only inside that form.
Isolation. Login controls never appear in the signup set.
Count. Each form reports its own control total.
Habit. Always scope on multi-form pages.
Example 4 — Official Speed Tip: .filter(":input")
Select with pure CSS first, then filter — official performance advice.
jQuery
var $controls = $("#survey *").filter(":input");
$("#out").text("Filtered controls: " + $controls.length);
// Same idea with a form context:
// $("form").find("*").filter(":input")
Disabled 4 control(s)
Text, select, checkbox, and button are all off
How It Works
Select.#checkout :input targets every control in that form.
Disable..prop("disabled", true) locks each control.
Verify.:disabled counts how many are now inactive.
Use case. Handy while a submit request is in flight.
Edge Cases & Pitfalls
Check these before relying on :input in real forms.
slow
Bare $(":input") scans the whole page
Scope with $("form :input") or use $("form *").filter(":input").
confuse
:input ≠ $("input")
The tag selector misses textarea, select, and button.
non-std
Not valid in querySelectorAll
:input is a jQuery extension. Use CSS + .filter(":input") for native speed.
narrow
Too broad for one field type
Need only text or checkboxes? Use :text or :checkbox instead.
Compatibility
Browser Support
The :input pseudo-class is a jQuery extension and has worked since jQuery 1.0. There is no native CSS equivalent; combine a pure CSS query with .filter(":input") for best performance.
✓ jQuery 1.0+ · extension
jQuery :input Selector
Supported across jQuery 1.x, 2.x, and 3.x wherever your jQuery build runs. Prefer form :input; use .filter(":input") after a CSS query for speed.
100%jQuery extension
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: Safe everywhere jQuery runs. Scope to a form; prefer $("form *").filter(":input") when performance matters.
Analysis
Performance Notes
Approach
Cost
Best for
$("form *").filter(":input")
Fastest
Large forms / hot paths (official tip)
$("form :input")
Cheap
Typical tutorials and small pages
$("#id :input")
Cheaper
Multi-form pages
$(":input")
Slower
Avoid — whole-document scan
Official jQuery docs note that because :input is not CSS, it cannot use the querySelectorAll boost. Select with a pure CSS selector first, then .filter(":input").
Remember
Key Takeaways
Role: select every form control — input, textarea, select, button.
Broader than tags:$(":input") ≠ $("input").
Scope: prefer $("form :input") on multi-form pages.
Speed:$("form *").filter(":input") — official performance tip.
One line:$("form :input") gathers every form control — broader than $("input") — and .filter(":input") after a CSS query is faster.
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. Official docs describe :input as selecting all form controls.
No. It is a jQuery extension (not part of the CSS specification), so queries using :input cannot use the native querySelectorAll boost. Official tip: select with a pure CSS selector first, then .filter(":input").
: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.