Open an output stream, add some text, then close the output stream:
More "Try it Yourself" examples below.
The close() method closes the output stream previously opened with the document.open() method, and displays the collected data in this process.
Method | |||||
---|---|---|---|---|---|
close() | Yes | Yes | Yes | Yes | Yes |
None |
Return Value: | No return value |
---|
Using window.open() together with document.open() to open an output stream in a new window, add some text, then close the output stream:
HTML DOM reference: HTML DOM open() method
HTML DOM reference: HTML DOM write() method
HTML DOM reference: HTML DOM writeln() method
Browser BOM reference: Window open() method