topical media & game development

talk show tell print

basic-javascript-06-ch6-examp5.htm / htm



  <html>
  <head>
  <script language="JavaScript" type="text/javascript">
  
  function DisplayEvent(eventName)
  {
     var myMessage = window.document.form1.textarea2.value;
     myMessage = myMessage + eventName;
     window.document.form1.textarea2.value = myMessage;
  }
  </script>
  </head>
  
  <body>
  <form name=form1>
     <textarea rows=15 cols=40 name=textarea1 
        onchange="DisplayEvent('onchange\n');" 
        onkeydown="DisplayEvent('onkeydown\n');" 
        onkeypress="DisplayEvent('onkeypress\n');" 
        onkeyup="DisplayEvent('onkeyup\n\n');"></textarea>
     <textarea rows=15 cols=40 name=textarea2></textarea>
     <br><br>
     <input type="button" value="Clear Event TextArea" 
        name=button1 onclick="window.document.form1.textarea2.value=''">
  </form>
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.