HTML DOM close() Method (original) (raw)

Last Updated : 11 Jul, 2025

The **DOM close() method is used to close the output stream. It is used to indicate the finish of writing on a window. The close() method does not require any parameter.

**Syntax:

document.close()

**Example 1: In this example, we will use **DOM close() method.

HTML `

DOM close Method

GeeksForGeeks

DOM close() Method

Submit

`

**Output:

**Example 2: This example uses a **window.close method to show the output in the new window.

html `

GeeksForGeeks

DOM close() Method

Submit

`

**Output:

**Supported Browsers: The browser supported by **DOM close() method are listed below: