Get all body html - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Body

Description

Get all body html

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 v  a 2  s . com
console.log(document.body.innerHTML);
document.body.innerHTML = document.body.innerHTML.replace('a', 'b');
console.log(document.body.innerHTML);
    }

      </script> 
   </head> 
   <body>
       " 
      <a>Customer: John Doe</a>
       " 
      <br> 
      <br> 
      <br>
       " 
      <a>Customer: John</a>
       "  
   </body>
</html>

Related Tutorials