Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM close() method

HTML DOM close() method

Document Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the close() method.


Example

Example 1

Open an output stream, add some text, then close the output stream:

Runoob Tutorial(runoob.com)

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 Reference Document Object