topical media & game development

talk show tell print

#javascript-code-10-traditional.js / js



  // Find the first <form> element and attach a ‘submit’ event handler to it
  document.getElementsByTagName(“form”)[0].onsubmit = function(e){
      // Stop all form submission attempts
      return stopDefault( e );
  };
  
  // Attach a keypress event handler to the <body> element of the document
  document.body.onkeypress = myKeyPressHandler;
  
  // Attach an load event hanlder to the page
  window.onload = function(){ … };
  


(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.