:resetS2C Home « Selectors « :reset

Form reset selector.

Shorthand version $(':reset')

Description

The :reset selector, selects all elements of type reset.

Being a jQuery extension the :reset pseudo selector is not part of any current CSS specification. Therefore :reset cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method.

The same results can be achieved with valid CSS using $('[type=reset]'), without the hit to performance.

If this selector is not preceded by another selector, the universal selector ("*") is implied and so the whole DOM will be searched. Use another selector as in the example below to narrow the search and improve performance.

Syntax


Signature Description
jQuery(':reset')Form reset pseudo-class match

Parameters

None.

Return

N/A.

:reset ExampleTop

Selects all elements of type reset.

In the example below we apply an orange background to 'reset' elements within the form.


$(function(){
  $('.ourform').submit(function () { return false; }); // disable submit 
  $('#btn8').on('click', function() {
    $('form input:reset').css('backgroundColor', 'orange');
  });
});

Pie Survey     

Userame:      

Password:               

     

Which pie do you prefer?:

Select a pie shape: 

            


Press the button below to action the above code:


All the jQuery 1.9 lessons are listed below. Click a link to go to that lesson.

jQuery 1.9 Basics

jQuery 1.9 Intermediate

jQuery 1.9 Advanced

jQuery 1.9 Reference

API by Function

API Alphabetically

Core & Internals

Selectors

CSS 1/2 Selectors

All ('*')

Attribute Contains Prefix

Attribute Contains Word

Attribute Equals

Child

Class ('.class')

Descendant

Element

:last-child

Has Attribute

ID ('#id')

Multiple

Next Adjacent

CSS 3 Selectors

Attribute Contains

Attribute Ends With

Attribute Starts With

:checked

:disabled

:empty

:enabled

:last-of-type

:lang

:last-child

:last-of-type

Next Siblings

:not()

:nth-child()

:nth-last-child()

:nth-last-of-type()

:nth-of-type()

:only-child

:only-of-type

:root

:target

Custom Selectors

:animated

Attribute Not Equal

:contains()

:first

:has()

:header

:hidden

:last

Multiple Attribute

:parent

:visible

jQuery Form Selectors

:button

:checkbox

:file

:focus

:image

:input

:password

:radio

:reset

:selected

:submit

:text

Index Positional Selectors

:eq()

:even

:gt()

:lt()

:odd

DOM Element Methods

Traversal

Attributes & Properties

Filtering

Manipulation

Effects

Utilities

Events

Objects

Ajax