:button (since jQuery 1.0) selects every <button> element and every <input type="button">. It does not match submit or reset inputs. Official CSS equivalent: $("button, input[type='button']").
Scope to a form, then count, style, or disable every button control.
Prefer $("form :button") over bare $(":button") on large pages.
Remember it includes input[type="button"] — not just <button>.
For speed: $("button, input[type='button']") or $("form *").filter(":button").
Use :submit / :reset when you need those input types instead.
Piece
Required?
Role
Selector string
Yes
:button filter (best scoped to a form)
Form / context
Recommended
Avoids buttons in unrelated widgets
.filter(":button")
Optional
Official pattern after a pure CSS query
Return value
—
jQuery collection of button controls (may be empty)
Pseudocode
Pseudocode
matches = []
for each element in search context:
if element.tag is button:
matches.add(element)
else if element.tag is input
and element.type is "button":
matches.add(element)
return matches
// Faster pattern:
candidates = querySelectorAll("button, input[type='button']")
return jQuery(candidates)
Reference
Cheat Sheet
Keep these facts handy while selecting button controls.
Topic
Detail
Syntax
$(":button") / $("form :button")
Since
jQuery 1.0 · jQuery extension
Matches
button + input[type=button]
Skips
submit, reset, other input types
CSS equivalent
$("button, input[type='button']")
Speed tip
$("form *").filter(":button")
Official demo
Mark matches; report .length
Native CSS
No — use CSS + .filter()
Try it
Live Preview
Run different selectors against a small sample form and see which button controls match.
Sample markup mirrors the official jQuery form demo (input button, checkbox, submit, text, and a <button>).
Short, copy-ready snippets. Open a browser with jQuery loaded, or use Try It Yourself for a live editor.
Example 1 — Official Demo: Count :button
Mark all button controls and report how many matched (jQuery API example).
jQuery
var input = $(":button").addClass("marked");
$("div").text("For this type jQuery found " + input.length + ".");
// Prevent the form from submitting
$("form").on("submit", function (event) {
event.preventDefault();
});
Any <button> tag matches :button, even when its type is submit.
slow
Bare $(":button") scans the whole page
Scope with $("form :button") or use CSS + .filter(":button").
non-std
Not valid in querySelectorAll
Prefer $("button, input[type='button']") for native speed.
Compatibility
Browser Support
The :button pseudo-class is a jQuery extension and has worked since jQuery 1.0. Prefer the CSS equivalent button, input[type='button'], or a pure CSS query plus .filter(":button").
✓ jQuery 1.0+ · extension
jQuery :button Selector
Supported across jQuery 1.x, 2.x, and 3.x wherever your jQuery build runs. Prefer button, input[type='button']; use .filter(":button") 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
:buttonUniversal
Bottom line: Safe everywhere jQuery runs. Scope to a form; prefer the CSS-equivalent selector when performance matters.
Analysis
Performance Notes
Approach
Cost
Best for
$("button, input[type='button']")
Fastest
Native CSS equivalent (official)
$("form *").filter(":button")
Fast
Large forms / hot paths
$("form :button")
Cheap
Typical tutorials and small pages
$(":button")
Slower
Avoid — whole-document scan
Official jQuery docs note that because :button is not CSS, it cannot use the querySelectorAll boost. Select with a pure CSS selector first, then .filter(":button").
Remember
Key Takeaways
Role: match <button> and input[type=button].
Broader than tags:$(":button") ≠ $("button").
Not submit: use :submit / :reset for those inputs.
Speed: CSS equivalent or .filter(":button").
One line:$(":button") gathers <button> and input[type=button] — prefer the CSS equivalent when speed matters.
Frequently Asked Questions
:button selects every button element and every input whose type is exactly button. It does not select input type submit, reset, checkbox, or other control types.
$("button") matches only <button> tags. $(":button") also includes input[type="button"]. If your form uses both, :button gathers both kinds.
No. It is a jQuery extension since version 1.0. The CSS-equivalent selector is $("button, input[type='button']"). Native querySelectorAll cannot run :button directly.
No. input[type="submit"] is matched by :submit, not :button. A <button> element still matches :button even when type="submit", because it is a button tag.
Use $("button, input[type='button']") for native querySelectorAll speed, or select with a pure CSS selector then .filter(":button") as the official docs recommend.
In the official jQuery form demo, :button finds two elements — one input[type="button"] and one button element — while skipping submit, reset, text, and other controls.