EN
HTML - reset input
3
points
In this article, we would like to show you how to use reset input button to reset form in HTML.
Quick solution:
<input type="reset" value="Reset Form" />
Note:
The reset
input
button resets each filed insideform
element.
Practical example
In this example, we create reset input
that appears as a button that resets form
to default values (empty strings are default values).
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<body>
<form>
<label>
<span>Username</span>
<input type="text" name="username" />
</label>
<br />
<label>
<span>Password</span>
<input type="password" name="password" />
</label>
<br />
<input type="reset" value="Reset Form" />
</form>
</body>
</html>