文件: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

瀏覽器相容性