jQuery :submit Selector

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Form submit

What You’ll Learn

The :submit selector matches every submit-type form control — input[type=submit] and button[type=submit]. Available since jQuery 1.0; always specify type on buttons for cross-browser consistency.

01

Syntax

:submit

02

Post form

Send data

03

Official

td :submit

04

vs :button

Different type

05

type=

Always set

06

Native CSS

Faster query

Introduction

Every HTML form needs a way to send data — submit buttons trigger the browser’s form submission. jQuery’s :submit pseudo-class selects every control whose type is submit, whether rendered as an <input> or a <button>.

Official jQuery documentation notes that some browsers treat <button> as submit implicitly while others do not — always write an explicit type attribute. The official demo finds td :submit descendants, styles their parent cells, and reports the match count.

Understanding the :submit Selector

Think of :submit as “which controls will post this form?”:

  • input[type=submit] → classic submit input.
  • button[type=submit] → submit styled as a button tag.
  • input[type=button] → no match — use :button.
  • input[type=reset] → no match — use :reset.
💡
Beginner Tip

Use type="button" for JavaScript-only actions and type="submit" for form posting — then :submit and :button never overlap on inputs.

📝 Syntax

Official jQuery API form (since 1.0):

jQuery
jQuery( ":submit" )

// scoped queries:
$( "form :submit" )
$( "td :submit" )

// native CSS (official docs recommendation):
$( 'input[type="submit"], button[type="submit"], button:not([type])' )

// avoid bare universal scan on huge pages:
$( ":submit" )   // implies *:submit

// not for plain buttons:
$( "input:button" )

Parameters

  • No arguments — keeps elements whose submit behavior applies.

Return value

  • A jQuery object containing every matching submit control (zero or more).

Official jQuery API example

jQuery
var submitEl = $( "td :submit" )
  .parent( "td" )
  .css({
    background: "yellow",
    border: "3px red solid"
  })
  .end();

$( "#result" ).text( "jQuery matched " + submitEl.length + " elements." );

⚡ Quick Reference

Element:submit:button
<input type="submit">MatchesNo match
<button type="submit">MatchesAlso matches :button
<input type="button">No matchMatches
<input type="reset">No matchNo match
Native querySelectorAllUse attribute selectorsbutton, input[type=button]

📋 :submit vs :button and :reset

Form action controls — each type has its own jQuery pseudo-class.

:submit
:submit

Post form data

:button
:button

Plain buttons

:reset
input:reset

Clear defaults

Native CSS
input[type="submit"]

Official perf tip

Examples Gallery

Example 1 follows the official jQuery td :submit demo. Examples 2–5 cover contrast with :button, native attribute selectors, scoped form queries, and preventing double submission.

📚 Official jQuery Demo

Style parent cells of every submit control in a table.

Example 1 — Official Demo: td :submit

Official jQuery demo — highlight td cells containing submit controls and report the count.

jQuery
var submitEl = $( "td :submit" )
  .parent( "td" )
  .css({
    background: "yellow",
    border: "3px red solid"
  })
  .end();

$( "#result" ).text( "jQuery matched " + submitEl.length + " elements." );

$( "form" ).on( "submit", function( event ) {
  event.preventDefault();
} );
Try It Yourself

How It Works

.parent("td").css(...).end() styles the table cell while keeping the original submit collection for .length.

Example 2 — :submit vs :button

Disable plain buttons during AJAX while keeping submit controls enabled.

jQuery
$( ":button" ).prop( "disabled", true );
$( ":submit" ).prop( "disabled", false );

// input[type=button] → :button only
// input[type=submit] → :submit only
Try It Yourself

How It Works

Each input type maps to a different pseudo-class — mixing them up disables the wrong controls.

📈 Practical Patterns

Native selectors, form scoping, and UX guards.

Example 3 — Native Performance: Attribute Selectors

Official docs — replace :submit with standard CSS for querySelectorAll speed.

jQuery
$( 'input[type="submit"], button[type="submit"], button:not([type])' )
  .addClass( "submit-btn" );

// Pure DOM equivalent:
document.querySelectorAll(
  'input[type="submit"], button[type="submit"], button:not([type])'
);
Try It Yourself

How It Works

The button:not([type]) part covers legacy implicit-submit buttons — still specify type in new markup.

Example 4 — Scoped Query: $("#signupForm :submit")

Style submit buttons in one form only — skip unrelated forms on the page.

jQuery
$( "#signupForm :submit" ).addClass( "primary-submit" );

// loginForm submit buttons are not affected
Try It Yourself

How It Works

Prefix the form id before :submit to limit matches to one form context.

Example 5 — Prevent Double Submit

Disable all submit controls after the first click to stop duplicate posts.

jQuery
$( "#checkoutForm" ).on( "submit", function() {
  $( this ).find( ":submit" ).prop( "disabled", true );
  $( "#status" ).text( "Processing…" );
} );
Try It Yourself

How It Works

Scoping with .find(":submit") inside the submitted form disables every submit control in that form only.

🚀 Common Use Cases

  • Checkout flows — disable :submit after first post.
  • Multi-step wizards — style the active step’s submit button.
  • AJAX forms — lock :button but keep :submit enabled.
  • Validation — enable submit only when required fields pass checks.
  • Admin tables — highlight rows with submit controls (official demo pattern).
  • Performance — prefer attribute selectors over bare :submit.

🧠 How jQuery Evaluates :submit

1

Parse selector

Combine a scope (form, td) with :submit.

Query
2

Find candidates

Collect elements in scope — or all nodes if bare :submit.

Scan
3

Filter by type

Keep inputs with type=submit and submit-type buttons.

Match
4

Return collection

Chain .prop(), .on("click"), or styling methods.

📝 Notes

  • Available since jQuery 1.0 — for submit-type inputs and buttons.
  • jQuery extension — not valid in native querySelectorAll(":submit").
  • Always specify type on <button> elements (official docs).
  • input[type=submit] matches :submit, not :button.
  • button[type=submit] matches both :submit and :button.
  • Official native alternative — input[type="submit"], button[type="submit"], button:not([type]).

Browser Support

The :submit pseudo-class is a jQuery extension and works in jQuery 1.0+. Submit behavior is standard HTML in all browsers; use attribute selectors for native querySelectorAll as jQuery docs recommend.

jQuery 1.0+ · extension

jQuery :submit Selector

Form submit controls — always set type on buttons.

100% jQuery + native attr
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
:submit Universal

Bottom line: Scope with form :submit; prefer input[type="submit"] for native speed.

Conclusion

The :submit selector matches every form control that posts data — the official demo finds them inside table cells and reports the match count.

Always write explicit type attributes on buttons, and use native attribute selectors when performance matters.

💡 Best Practices

✅ Do

  • Write type="submit" or type="button" on every button
  • Scope with $("#form :submit")
  • Disable :submit after first post to prevent duplicates
  • Use attribute selectors for native performance
  • Distinguish :submit from :button in form logic

❌ Don’t

  • Leave <button> without a type attribute
  • Use bare $(":submit") on large pages
  • Expect :submit in querySelectorAll
  • Confuse :submit with :reset or :button on inputs
  • Disable all :button when you meant to keep submit enabled

Key Takeaways

Knowledge Unlocked

Five things to remember about :submit

Post the form.

5
Core concepts
type 02

Set type

Always

Rule
btn 03

≠ :button

On inputs

Tip
td 04

Official

Table demo

Compare
CSS 05

Native

[type=]

Demo

❓ Frequently Asked Questions

:submit selects every form control whose type is submit — typically input[type="submit"] and button[type="submit"]. Official jQuery docs note it applies to button or input elements. Available since jQuery 1.0.
:submit matches submit-type controls that post the form. :button matches button tags and input[type="button"] plain buttons. input[type="submit"] matches :submit, not :button — but a button tag with type="submit" matches both :button and :submit.
Yes. Official jQuery docs warn that some browsers treat button as type="submit" implicitly while others do not. Always specify type="submit" or type="button" for consistent markup and reliable selector matching.
Official docs recommend input[type="submit"], button[type="submit"], button:not([type]) for querySelectorAll performance instead of the jQuery :submit extension.
The official demo runs $("td :submit"), styles the parent td cells yellow with a red border, and reports how many submit elements matched — typically two in the sample table (input submit + button type="submit").
:submit matches controls that send form data to the server. :reset matches input[type="reset"] controls that restore default field values. Each maps to a different input type.
Did you know?

A single HTML form can contain multiple submit controls — for example a “Save draft” and “Publish” button. Clicking either one submits the form, but only the clicked button’s name and value are included in the POST data. jQuery’s :submit finds every such control so you can style or disable them together.

Continue to :root Selector

After submit buttons, learn how :root selects the document root element.

:root selector tutorial →

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.

6 people found this page helpful