<html>
<body>
<p>Enter names in the fields below, then click "Reset" to reset the form.</p>
<form id="frm1">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br><br>
<input type="button" onclick="myFunction()" value="Reset">
</form>
<script>
function myFunction() {
document.getElementById("frm1").reset();
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_form_reset by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:07:06 GMT -->
</html>