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.

HTMLElement.contentEditable

概述

HTMLElement.contentEditable 属性用于表明元素是否是可编辑的。该枚举属性(enumerated attribute)可以具有下面的几种值之一:

  • "true" 表明该元素可编辑。
  • "false" 表明该元素不可编辑。
  • "inherit" 表明该元素继承了其父元素的可编辑状态。

语法

editable = element.contentEditable
element.contentEditable = "true"

规范

Specification Status Comment
WHATWG HTML Living Standard
contenteditable
Living Standard  
 

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 11 3.0 (1.9) 6 10.6 3.2
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 3 1.0 (1.9) 6 未实现 5

Bugs

相关链接

 

文档标签和贡献者

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