Below is an example of code I have been reading through theJavascript into on and I cannot for the life of me figure out why you woud want to use the document.write command instead of just normal means (<p>TEST</p>)

Can someone enlighten me?

< html>


<h1>My First Web Page</h1>

<p>My First Paragraph.</p>

<button onclick="myFunction()">Try it</button>

function myFunction()
document.write("Oops! The document disappeared!");