VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-close-method/

⇱ HTML DOM close() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM close() Method

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.

Output:

👁 Image

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

Output:

👁 Image

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

Comment
Article Tags: