HTML DOM close() method
Document Object
Definition and Usage
close() The method is used to close an output stream opened by document.open method, and displays the selected data.
Syntax
document.close()
Browser support





All major browsers support the close() method.
Example
Example 1
Open an output stream, add some text, then close the output stream:
Try it »
Example 2
Open an output stream (opens in a new window; about:blank), add text, then close the output stream:
Try it »
Document Object