Form reset() Method
Form Object
Definition and Usage
The reset() method resets the values of all elements in a form (same as clicking
the Reset button).
Syntax
Browser Support

The reset() method is supported in all major browsers.
Example
Example
Create a button that resets the form:
<html>
<head>
<script>
function formReset()
{
document.getElementById("frm1").reset();
}
</script>
</head>
<body>
<form id="frm1">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="button" onclick="formReset()" value="Reset
form">
</form>
</body>
</html>
Try it yourself »
Form Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]