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