Name

HTMLDocument.close( ): close an open document and display it — DOM Level 0

Synopsis

void close( );

Description

This method closes a document stream that was opened with the open( ) method and forces any buffered output to be displayed. If you use the write( ) method to dynamically output a document, you must remember to call this method when you are done to ensure that all your document content is displayed. Once you have called close( ), you should not call write( ) again, as this implicitly calls open( ) to erase the current document and begin a new one.

See Also

HTMLDocument.open( ), HTMLDocument.write( )

Get JavaScript: The Definitive Guide, 5th 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.