Document.close()

The document.close() method finishes writing to a document, opened with document.open().

Syntax

JavaScript
document.close();

Example

JavaScript
// open a document to write to it.
// write the content of the document.
// close the document.
document.open();
document.write("<p>The one and only content.</p>");
document.close();

Specification

DOM Level 2 HTML: close() Method

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/document/close

API Document HTML DOM Method NeedsCompatTable NeedsMarkupWork NeedsSpecTable Reference Référence