Add line break to body - Javascript DOM

Javascript examples for DOM:Element innerHTML

Description

Add line break to body

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/* www .  j  a  va 2 s  .com*/
document.body.innerHTML = "Testing...";
{
  document.body.innerHTML += "1";
  document.body.innerHTML += "2";
  document.body.innerHTML += "3";
}
document.body.innerHTML += "<br/>...and there you have it!"
    }

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

Related Tutorials