jQuery :reset Selector

Beginner
5 min read
Updated: Nov 2026
3 examples
Selectors

Definition

:reset (since jQuery 1.0) selects every element of type reset — the control that restores a form to its initial defaults. Official docs state it is equivalent to [type="reset"]. Prefer $("input:reset") over bare $(":reset").

Syntax

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

jQuery
$("input:reset")              // reset inputs (official style)
$("form input:reset")         // reset inside a form
$("input[type=reset]")        // equivalent attribute form

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

// Clicking reset restores form defaults (browser behavior)
CallWhat it does
Selector string:reset filter (best with an input prefix)
Form / contextLimits the search to one form
Event handlerConfirm, analytics, or custom clear logic
Return valuejQuery collection of matching reset controls (may be empty)

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

Parameters

ParameterDescription
Step 1Write $("input:reset") — avoid bare $(":reset") on large pages.
Step 2Scope to a form: $("#signup input:reset").
Step 3Style or disable the control 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 — Official Demo: input:reset

Style reset inputs and print the match count (jQuery API example).

jQuery
var input = $("input:reset");
$("#count").text("For this type jQuery found " + input.length + ".");
Try It Yourself

How It Works

  1. Query. $("input:reset") finds reset-type inputs only.
  2. Filter. Text, submit, and checkbox controls are ignored.
  3. Count. .length is how many reset inputs matched.

Example 2 — Equivalence: :reset vs [type=reset]

Official docs — both forms select the same type of control.

jQuery
var a = $("input:reset").length;
var b = $("input[type=reset]").length;

console.log("input:reset →", a);
console.log("[type=reset] →", b);
console.log("same set?", a === b);
Try It Yourself

How It Works

  1. Pseudo. :reset is the jQuery shorthand for reset-type controls.
  2. Attribute. [type=reset] is the standard CSS equivalent.
  3. Compare. Matching lengths mean both forms found the same inputs.

Example 3 — input:reset vs input:submit

Reset and submit are different types — select each independently.

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

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

How It Works

  1. Reset filter. :reset keeps only reset inputs.
  2. Submit filter. :submit keeps only submit inputs.
  3. No overlap. A single input has one type — it cannot match both.

Frequently Asked Questions

:reset selects every element whose type is reset — usually an input that restores a form to its initial defaults. $("input:reset") finds reset inputs 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 demos use input:reset.
Yes. Official docs state that :reset is equivalent to [type="reset"]. For native querySelectorAll performance, prefer input[type="reset"] over the :reset pseudo-class.
:reset matches type=reset. :submit matches submit controls. :button matches button-type controls (and <button> tags in the :button selector). They select different form controls — no overlap for a single input’s type.
The browser restores every control in that form to its initial default values. :reset only selects the reset control itself — it does not perform the reset. Use a click handler if you need custom confirm-before-reset behavior.
No. It is a jQuery extension (not part of the CSS specification), so queries using :reset cannot use the native querySelectorAll boost. Use [type="reset"] when performance matters.

Next: :submit Selector — Select Submit Buttons

Learn how to select submit buttons in forms with the :submit selector.

:submit Selector — Select Submit Buttons 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