Document:designMode 属性
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
document.designMode
控制整个文档是否可编辑。有效值为 "on"
和 "off"
。根据规范,该属性默认为 "off"
。Firefox 遵循这一标准。早期版本的 Chrome 和 IE 默认为 "inherit"
。从 Chrome 43 开始,默认为 "off"
并不再支持 "inherit"
。在 IE6-10 中,该值为大写。
值
字符串,表示 designMode
是否(或应该)设置为开启或关闭。有效值为 on
和 off
。
示例
使 <iframe>
的文档可编辑:
js
iframeNode.contentDocument.designMode = "on";
规范
Specification |
---|
HTML # dom-document-designmode-dev |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
designMode |
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.