revision:
The document.write() method writes a string of text to a document stream opened by document.open().
Use of the document.write() method is strongly discouraged.
document.write(exp1, exp2, ..., expN)
Parameters:
exp1, ... : optional. The output stream. Multiple arguments are appended to the document in order of occurrence.
<body onload="newContent();"> <p>Some original document content.</p> </body> <script> function newContent() { document.open(); document.write("<h1>Out with the old, in with the new!</h1>"); document.close(); } </script> document.write("Hello World!"); document.write("<h2>Hello World!</h2><p>Have a nice day!</p>"); document.write(Date());