HTML reference
input type="reset"
A reset input returns the controls in its form to their initial values. It does not submit the form.
What you will learn
- What “initial value” means for a reset
- How reset differs from submit
- How to prevent accidental data loss
Basic example
<form>
<label>Name <input name="name" value="Yugien"></label>
<button type="submit">Save</button>
<input type="reset" value="Restore initial values">
</form>The initial value comes from the control's markup, such as its value attribute. A reset does not necessarily restore the value the user last saved or the value loaded by your application.
Use it carefully
- Resetting can erase a long form without confirmation.
- Use a clear label that describes exactly what will happen.
- For an important or destructive workflow, prefer a visible confirmation or omit the reset control.
- Use
button type="button"for a custom action that should not submit or reset automatically.