Clear inner HTML - Javascript DOM

Javascript examples for DOM:Element innerHTML

Description

Clear inner HTML

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   w  w  w .  jav  a 2  s .  c o  m
        document.getElementById("goy").innerHTML = what;
    }
    function blah() {
        document.getElementById("goy").innerHTML = "";
    }
    
      </script>  
   </body>
</html>

Related Tutorials