Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. Document
  4. Document:close() 方法

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

Document:close() 方法

Document.close() 方法用于完成对使用Document.open() 打开的文档的写入。

语法

js
close()

参数

无。

返回值

无(undefined)。

示例

js
// 打开文档并写入document.open();// 在文档中编写内容document.write("<p>独一无二的内容。</p>");// 关闭文档document.close();

规范

Specification
HTML
# dom-document-close-dev

浏览器兼容性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp