Passing a string to innerHTML - Javascript DOM

Javascript examples for DOM:Element innerHTML

Description

Passing a string to innerHTML

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <div id="harv1244" onmouseover="lookdown(this)" onmouseout="lookup(this,'apples')">
          dummy //from  ww w. j a v a  2s . co  m
      </div> 
      <script type="text/javascript">
function lookdown(ele) {
    ele.innerHTML="See details below";
}
function lookup(ele,crop) {
    ele.innerHTML=crop;
}

      </script>  
   </body>
</html>

Related Tutorials