Key Event



Write a javascript code to implement onkeypress Event .

<html>
  <head>
    <title>Key Event Demo</title>
      <script>

        function press()
        {
            document.frm1.b1.value="key press";
        }

      </script>
    </head>
  <body>

<form name="frm1">

      <input type="text" name="t1" value="" onkeypress="press()">
      <br>

      <input type="button" name="b1" value="key">
       
    </form>        
  </body>
</html>

Output: