jQuery :reset Selector

The jQuery :reset selector selects all the input type reset elements in a form. A reset button is used in the form to reset all the form fields. It’s enough to have a single reset button to reset all fields in one click.

jQuery :reset Selector

Syntax of the Selector

The syntax of jQuery :reset selector is given below.

Syntax
$(“:reset”)

The selector requires no parameter to use and select the element. There is no need to use any selector like class or id to select the required element.

jQuery :reset Selector Selects Input Type Reset Buttons in a Form

There may be multiple buttons inside the form. You may like to highlight the reset button. After highlighting it, you can easily identify it to click when you require to reset form fields. See the example given below to see the button.

Example

Test it Live

Output




The above example showing the highlighted reset button element. The selector first selects the element and then apply the background color to it. The example showing the yellow-colored button which highlights the reset button. You can now easily identify it and click when you need to reset form fields.

If you have any queries regarding this tutorial post, please comment below.

Also tell me, what other methods you are using with the selector by commenting below.

References