Name

Document.close( ) — close an output stream

Availability

JavaScript 1.0

Synopsis

                  document.close(  )

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( )), the document is implicitly cleared and reopened, erasing all the output that was written prior to calling the close( ) method.

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.