: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").
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$(":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
Call
What it does
Selector string
:input filter (best scoped to a form)
Form / context
Avoids controls in unrelated widgets
.filter(":input")
Official pattern after a pure CSS query
Return value
jQuery collection of form controls (may be empty)
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
":input"
Used in .filter(":input"). Official pattern after a pure CSS query
Return Value
Return Value
Description
See examples
Check the examples below for what this API returns in common cases.
jQuery Examples
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.
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.