Javascript examples for DOM:Document body
Document body Property - Change the HTML content of the current document and overwrite all existing HTML elements inside <body>
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*w ww . ja va 2 s. com*/ document.body.innerHTML = "Some new HTML content"; } </script> </body> </html>