// Open a document to write to it
document.open();
// Write the content of the document
document.write("<p>The one and only content.</p>");
// Close the document
document.close();Document: close() method / notebook
Document: close() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.