open
The open() methods opens a document stream for writing.
Syntax
document.open()
Parameters
None.
Example
// In this example, the document contents are
// overwritten as the document
// is reinitialized on open().
document.write("<html><p>remove me</p></html>");
document.open(); // document is empty.
|
Notes
If a document exists in the target, this method clears it (see the example above). Also, an automatic document.open() is executed if document.write() is called after the page has loaded.
Specification
open