jQuery :reset Selector

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

What You’ll Learn

The :reset selector matches every <input type="reset"> element — the control that restores a form to its default values. Available since jQuery 1.0; equivalent to [type=reset]; always prefer input:reset over bare :reset.

01

Syntax

input:reset

02

type=reset

Clear form

03

Official

Style + count

04

vs :button

Different type

05

vs :submit

Not submit

06

Native CSS

Faster query

Introduction

Registration forms, settings panels, and search filters often include a reset button so users can undo edits and return to the starting state. jQuery’s :reset pseudo-class selects every input whose type attribute is reset.

Official jQuery documentation notes that :reset is equivalent to [type=reset], and recommends prefixing with input — bare $(":reset") implies $("*:reset"). When clicked, a reset control triggers the browser’s native form-reset behavior unless you intercept it.

Understanding the :reset Selector

Think of :reset as a shortcut for reset-type inputs only:

  • input:reset → every reset button in scope.
  • $("#signup input:reset") → reset controls in one form.
  • input:button → different type — plain buttons, not reset.
  • Clicking reset restores fields to their initial HTML default values.
💡
Beginner Tip

Reset buttons are less common today than “Clear” links wired in JavaScript, but :reset still matches the native HTML control when it exists.

📝 Syntax

Official jQuery API form (since 1.0):

jQuery
jQuery( ":reset" )

// recommended — prefix with input:
$( "input:reset" )
$( "form input:reset" )

// equivalent attribute form:
$( "input[type=reset]" )

// native CSS (better performance):
document.querySelectorAll( 'input[type="reset"]' )

// avoid on large pages:
$( ":reset" )   // implies *:reset

Parameters

  • No arguments — keeps elements whose type is reset.

Return value

  • A jQuery object containing every matching reset input (zero or more).

Official jQuery API example

jQuery
var input = $( "input:reset" ).css({
  background: "yellow",
  border: "3px red solid"
});

$( "div" )
  .text( "For this type jQuery found " + input.length + "." )
  .css( "color", "red" );

⚡ Quick Reference

Elementinput:resetinput[type="reset"]
<input type="reset">MatchesMatches
<input type="button">No matchNo match
<input type="submit">No matchNo match
<button type="reset">No matchNo match
Native querySelectorAllNot supportedSupported

📋 :reset vs :button and :submit

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

:reset
input:reset

Restore defaults

:button
input:button

Plain buttons

:submit
input:submit

Send form data

[type=reset]
input[type="reset"]

Native CSS — faster

Examples Gallery

Example 1 follows the official jQuery input:reset demo. Examples 2–5 cover attribute equivalence, contrast with other button types, scoped form queries, and the native performance pattern.

📚 Official jQuery Demo

Style every reset input and report how many matched.

Example 1 — Official Demo: input:reset

Official jQuery demo — yellow background, red border, and match count in red text.

jQuery
var input = $( "input:reset" ).css({
  background: "yellow",
  border: "3px red solid"
});

$( "div" )
  .text( "For this type jQuery found " + input.length + "." )
  .css( "color", "red" );

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

How It Works

jQuery finds reset inputs, applies inline styles, and reports .length. Form submit is blocked so the demo page does not reload.

Example 2 — Equivalence: [type=reset]

Official docs — :reset and the attribute selector find the same elements.

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

How It Works

Both forms select the same DOM nodes — choose attribute syntax when native speed matters.

📈 Practical Patterns

Button contrast, form scoping, and native queries.

Example 3 — input:reset vs input:button

Highlight reset controls without styling plain button inputs in the same form.

jQuery
$( "input:reset" ).addClass( "reset-highlight" );
$( "input:button" ).addClass( "btn-highlight" );

// :reset → input[type=reset] only
// :button → button tags + input[type=button]
Try It Yourself

How It Works

input type="reset" does not match :button — each pseudo-class targets a different control type.

Example 4 — Scoped Query: $("#searchForm input:reset")

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

jQuery
$( "#searchForm input:reset" ).addClass( "clear-btn" );

// loginForm reset buttons are not affected
Try It Yourself

How It Works

Prefix the form id before input:reset to limit the matched set to one form context.

Example 5 — Native Performance: input[type="reset"]

Official docs — use attribute selector in modern browsers for querySelectorAll speed.

jQuery
$( "input[type='reset']" ).on( "click", function() {
  console.log( "Form will reset to defaults" );
});

// Pure DOM (no jQuery pseudo-class):
document.querySelectorAll( "input[type='reset']" );
Try It Yourself

How It Works

Because :reset is not standard CSS, attribute matching lets the browser optimize the query.

🚀 Common Use Cases

  • Search filters — style or count input:reset in filter forms.
  • Registration wizards — highlight the clear-all control at the bottom.
  • Settings panels — confirm before native reset with a click handler.
  • Multi-form pages — scope with $("#formId input:reset").
  • Accessibility — pair reset inputs with descriptive value or aria-label text.
  • Performance — prefer input[type="reset"] in hot paths.

🧠 How jQuery Evaluates :reset

1

Parse selector

Combine input with :reset — optionally scope to a form id.

Query
2

Find candidates

Collect input elements in scope (or all elements if bare :reset).

Scan
3

Filter by type

Keep inputs where type attribute equals reset.

Match
4

Return collection

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

📝 Notes

  • Available since jQuery 1.0 — equivalent to [type=reset].
  • jQuery extension only — not valid in native querySelectorAll(":reset").
  • Always use input:reset — bare :reset implies universal scan.
  • Matches input[type="reset"] — not button[type="reset"] (use element + attribute selectors for that).
  • Does not match submit, button, text, or checkbox inputs.
  • Clicking reset restores the form — use event.preventDefault() if you need custom clear logic instead.

Browser Support

The :reset pseudo-class is a jQuery extension and works in jQuery 1.0+. The equivalent input[type="reset"] attribute selector is standard CSS and runs in native querySelectorAll in all modern browsers.

jQuery 1.0+ · extension

jQuery :reset Selector

Use input:reset in jQuery; use input[type="reset"] for native speed.

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
:reset Universal

Bottom line: Scope with form input:reset; prefer [type="reset"] when performance matters.

Conclusion

The :reset selector matches every input type="reset" element — the official demo styles them and reports the match count.

Prefix with input, scope to your form, and use [type="reset"] when you need native query performance.

💡 Best Practices

✅ Do

  • Write $("#form input:reset") for scoped queries
  • Use input[type="reset"] for native performance
  • Give reset buttons clear labels via value
  • Confirm destructive clears if users may lose work
  • Combine with form reset event for logging

❌ Don’t

  • Use bare $(":reset") on large pages
  • Expect :reset in querySelectorAll
  • Confuse :reset with :button or :submit
  • Assume <button type="reset"> matches input:reset
  • Rely on reset for file inputs — browser behavior varies

Key Takeaways

Knowledge Unlocked

Five things to remember about :reset

Reset-type inputs only.

5
Core concepts
= 02

[type=]

Equivalent

Rule
form 03

Scope

One form

Tip
btn 04

≠ :button

Separate

Compare
demo 05

Official

Style count

Demo

❓ Frequently Asked Questions

:reset selects every input element whose type attribute is reset — the control that restores a form to its initial default values. $("input:reset") finds all reset buttons in the search context. Available since jQuery 1.0.
Prefer $("input:reset"). Bare $(':reset') implies the universal selector and scans as $('*:reset'), which is slower on large pages. Official jQuery docs recommend prefixing with input or scoping to a form.
Yes. Official jQuery docs state that :reset is equivalent to $('[type="reset"]'). For native querySelectorAll performance in modern browsers, prefer input[type="reset"] over the :reset pseudo-class.
:reset matches input[type="reset"] only. :button matches button tags and input[type="button"]. :submit matches input[type="submit"] and button[type="submit"]. Each form pseudo-class maps to a different control type.
The browser restores every form control in that form to its initial default value — text fields clear to defaults, checkboxes uncheck, selects revert, and so on. jQuery can style reset buttons with :reset before or after that native behavior.
The official jQuery form demo styles $("input:reset") and reports how many were found — typically one reset input among text fields, checkboxes, buttons, and other controls in the sample form.
Did you know?

When a user clicks input[type="reset"], the browser fires a reset event on the form and restores every control to its initial default value. You can listen with $("#myForm").on("reset", fn) to log or confirm the action — or call event.preventDefault() on the reset button click to block native clearing.

Continue to :submit Selector

Learn how to select form submit buttons that post data to the server.

:submit 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