Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

document.designMode

 

概述

document.designMode 控制整个文档是否为可编辑的。有效值为 "on""off"。根据规范,该属性默认为 "off"。但在某些浏览器里为 "inherit",比如 IE,其中 IE6-10 中,该属性值首字母大写。

语法

var mode = document.designMode;
document.designMode = "on";
​document.designMode = "off";

示例

使一个 <iframe> 的整个文档可编辑:

iframe_node.contentDocument.designMode = "on";
 

规范

Specification Status Comment
WHATWG HTML Living Standard
designMode
Living Standard Initial definition.

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? ? ? ? ?

相关链接

文档标签和贡献者

 此页面的贡献者: AlexChao, teoli, ziyunfei, China zhangshuo
 最后编辑者: AlexChao,