<html>
<body>
<h1>The Document Object</h1>
<h2>The open() Method</h2>
<p>Open a document deletes existing content.</p>
<p>Open this document and write some text to it:</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.open();
document.write("<h1>Hello World</h1>");
document.close();
}
</script>
</body>
</html>