jQuery :submit Selector

Beginner
5 min read
Updated: Nov 2026
3 examples
Selectors

Definition

:submit (since jQuery 1.0) selects elements of type submit — usually <input type="submit"> and <button type="submit">. Official docs: always set a type on <button> so browsers agree on whether it submits.

Syntax

Start with these common calls. Keep them short and readable.

jQuery
$(":submit")                         // submit controls
$("input:submit")                    // input submit only
$("form :submit")                    // scoped to a form
$("td :submit")                      // official demo style

// Native / faster (official tip):
$('input[type="submit"], button[type="submit"]')

// Always set type on <button> for consistent matching
CallWhat it does
Selector string:submit filter (best with a context)
Form / cell contextLimits matches to one region
type on <button>Cross-browser submit behavior
Return valuejQuery collection of matching submit controls

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Write $("form :submit") or $("input:submit") instead of a vague bare scan when possible.
Step 2Give every <button> an explicit type="submit" or type="button".
Step 3Style, disable, or bind clicks with normal jQuery methods.

Return Value

Return ValueDescription
See examplesCheck the examples below for what this API returns in common cases.

jQuery Examples

Example 1 — Count Submit Controls

Official idea: find :submit matches and report the length.

jQuery
var submitEl = $("form :submit");
$("#result").text("jQuery matched " + submitEl.length + " elements.");
$("form").on("submit", function (e) { e.preventDefault(); });
Try It Yourself

How It Works

  1. Scope. form :submit searches submit controls inside the form.
  2. Match. Both input and button submit controls are included.
  3. Report. .length is how many matched.

Example 2 — input:submit vs button[type=submit]

See that :submit can match more than just <input>.

jQuery
console.log("input:submit →", $("input:submit").length);
console.log("button[type=submit] →", $("button[type=submit]").length);
console.log(":submit →", $(":submit").length);
Try It Yourself

How It Works

  1. Input only. input:submit ignores <button> elements.
  2. Button only. The attribute selector finds submit buttons.
  3. Union. :submit covers both kinds of submit control.

Example 3 — :submit vs :reset

Submit sends the form; reset clears it — different selectors.

jQuery
$(":submit").prop("value", "Send");
$("input:reset").prop("value", "Clear");

console.log("submit:", $(":submit").length);
console.log("reset:", $("input:reset").length);
Try It Yourself

How It Works

  1. Submit filter. :submit keeps submit controls only.
  2. Reset filter. :reset keeps reset inputs only.
  3. No overlap. One control has one type.

Frequently Asked Questions

:submit selects every form control of type submit — typically input[type="submit"] and button[type="submit"]. Official docs note it applies to button or input elements. Available since jQuery 1.0.
:submit matches controls that submit the form. :button matches button elements and input[type="button"]. A <button type="submit"> can match both :button and :submit; input[type="submit"] matches :submit, not :button.
Yes. Official docs warn that some browsers treat <button> as type="submit" implicitly while others (historically IE) do not. Always set type="submit" or type="button" for consistent markup and matching.
Official docs recommend input[type="submit"], button[type="submit"], button:not([type]) for querySelectorAll performance instead of the jQuery :submit extension.
:submit matches controls that send the form. :reset matches type=reset controls that restore default field values. They never overlap for a single control’s type.
No. It is a jQuery extension, so it cannot use the native querySelectorAll boost. Prefer the attribute selectors listed in the docs when performance matters.

Next: :root Selector — Document Root Element

Learn how to select the document root element with the :root selector.

:root Selector — Document Root Element tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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.

9 people found this page helpful