[Chapter 21] Reference: Document.close()
Author: David Flanagan
Date: Fri Aug 29 11:15:01 1997

#

| Chapter 21 JavaScript Reference |

# Document.close() Method

## Name

Document.close() Method---close an output stream

## Availability

Navigator 2.0, Internet Explorer 3.0

## Synopsis

    document.close()

### Arguments

none

### Returns

nothing

## Description

This method displays any output to `document` that has been written but not yet displayed, and closes the output stream to `document`. When generating complete HTML pages with `Document.write()`, you should invoke `Document.close()` when you reach the end of the page.

After `document``.close()` has been called, if any further output is written to `document` (e.g., with `document``.write()`) then the document will be implicitly cleared and reopened, erasing all the output that was written prior to calling the `close()` method.

## See Also

"Document", "Document.clear()", "Document.open()", "Document.write()"

Document.clear() |  | Document.cookie