Document:close() 方法
Document.close()
方法用于完成对使用 Document.open()
打开的文档的写入。
语法
js
close()
参数
无。
返回值
无(undefined
)。
示例
js
// 打开文档并写入
document.open();
// 在文档中编写内容
document.write("<p>独一无二的内容。</p>");
// 关闭文档
document.close();
规范
Specification |
---|
HTML # dom-document-close-dev |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
close |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.