Can someone enlighten me?
<h1>My First Web Page</h1>
<p>My First Paragraph.</p>
<button onclick="myFunction()">Try it</button>
document.write("Oops! The document disappeared!");
document.write() is document's object method for dynamically "writing" text to the web document (that is your web page). <p></p> is a standard HTML tag used to insert (not dynamically) paragraphs into a web document.
So above web document contains besides HTML "h1" and "p" tags a button whose onclick event handler is connected to the myfFunction() which when called writes down to the web page "Oops! The document disappeared!" text.