What is the usage of onreset event in JavaScript?

HTMLJavascriptProgramming Scripts

The onreset event is useful when a form is reset. You can try to run the following code to learn how to implement onreset event in JavaScript −

Example

<!DOCTYPE html>
<html>
   <body>
      <script>
         function resetFunct() {
            alert("The form was reset");
         }
      </script>
      <form onreset = "resetFunct()">
         Enter age: <input type = "number"><br>
         Enter birth month: <input type = "text"><br>
         <input type = "reset">
      </form>
   </body>
</html>
raja
Published on 26-Feb-2018 11:11:01
Advertisements