Handle mouse out and over event on <h1> - Javascript DOM Event

Javascript examples for DOM Event:onmouseout

Description

Handle mouse out and over event on <h1>

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>lala</title> 
   </head> 
   <body> 
      <h1 onmouseover="go('The dog is in its shed')" onmouseout="blah()">lalala</h1> 
      <div id="goy"></div> 
      <script type="text/javascript">
    function go(what) {/*from ww  w. j  a v a  2s. c  o m*/
        document.getElementById("goy").innerHTML = what;
    }
    function blah() {
        document.getElementById("goy").innerHTML = "";
    }
    
      </script>  
   </body>
</html>

Related Tutorials