Javascript examples for DOM:Document body
Document body Property - Get the HTML content of the current document:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w w w .j a va2 s . c o m*/ var x = document.body.innerHTML; document.getElementById("demo").innerHTML = x; } </script> </body> </html>