topical media & game development

talk show tell print

basic-javascript-12-IE-type-property.htm / htm



  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
  <html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
      <title>Using the type Property</title>
  
      <script type="text/javascript">
      function paragraph_eventHandler() {        
          if (window.event.type == "click") { //The onclick event was fired.
              alert("You Clicked Me!");
          } else if (window.event.type == "mouseover") { //The onmouseover event was fired.
              alert("You Tickled Me!");
          }
      }
      </script>
  </head>
  <body>
      <p onclick="paragraph_eventHandler()" onmouseover="paragraph_eventHandler()">
          Move your mouse over me. Click me, too!
      </p>
  </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.