文档:close() 方法

Document.close() 方法用于结束使用 Document.open() 打开的文档的写入。

语法

js
close()

参数

无。

返回值

无(undefined)。

示例

js
// Open a document to write to it
document.open();

// Write the content of the document
document.write("<p>The one and only content.</p>");

// Close the document
document.close();

规范

规范
HTML
# dom-document-close-dev

浏览器兼容性