Handle form reset event - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Reset

Description

Handle form reset event

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>sfs</title> 
      <style type="text/css">

form {/*  w ww  . j a  v  a 2s .  com*/
   width: 400px;
   height: 400px;
   border: solid black 1px;
}

      </style> 
      <script language="javascript" type="text/javascript">
function hello( form ) {
    form.style.backgroundColor = "#F26C4F";
}

      </script> 
   </head> 
   <body> 
      <form onreset="hello(this)"> 
         <input type="input" value="blah"> 
         <input type="reset" value="Reset"> 
      </form>  
   </body>
</html>

Related Tutorials