- Value of
- <input type="">
- What does
- Defines a button on a form that will return all fields to their default values.
<form action="myform.cgi"> <input type="password" name="password" id="password" maxlength="6"> <label for="password"> Type a fake password here</label> <br><input type="reset" value="Reset"> </form>
reset value of
input displays a Reset button on a form. Clicking this button will set all of the form fields back to their default value. In some cases, this will clear the fields, depending on the form settings.
Avoiding User Frustration
reset input is intended to provide an easy way for a user to start over, but it can have unintended consequences. We all know how easy it is to click Reset instead of Submit. If that happens, the user is going to clear all of their entries, rather than sending the data as intended. Most users don't particularly like it when this happens.
If you've provided a long form, it's a good idea to add a confirmation alert that prevents someone from hitting Reset accidentally. Also, take care to place the Reset button logically on the page, and ideally, well away from the Submit button.
reset is not obligatory, so if you don't need to include it, it's safest to completely omit it.
Browser Support for reset