<html>
<body>
<p id="demo">Click the button to replace this document with new content.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.open("text/html","replace");
document.write("<h2>Learning about the HTML DOM is fun!</h2>");
document.close();
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_doc_open by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 31 Mar 2021 13:04:43 GMT -->
</html>