English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
AttributeAttribute to set or return whether the element's content is editable.
You can also useisContentEditableAttribute to determine whether the element's content is editable.
Return the contentEditable attribute:
HTMLElement.contentEditable
Set the contentEditable attribute:
HTMLElement.contentEditable = true|false
document.getElementById("x").contentEditable = "true";")[0].contentEditable;/Test and See‹
表中的数字指定了完全支持contentEditable属性的第一个浏览器版本:
The numbers in the table specify the first browser version that fully supports the contentEditable attribute: | |||||
Attribute | 11 | 3contentEditable5 | 9 | 3contentEditable2 | 6 |
Attribute Value | Value |
---|---|
Description | true|false Indicates whether the element is editable.
|
Technical Details | Return Value: |
---|
More Examples3Check the first <h
Example3var x = document.getElementsByTagName("h"")[0].contentEditable;/Test and See‹
Related ReferencesHTML DOM isContentEditable Reference:
HTML Reference:HTML contenteditable attribute