HTMLElement: contentEditable property
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.
* Some parts of this feature may have varying levels of support.
ThecontentEditable property oftheHTMLElement interface specifies whether or not the element iseditable.
This enumerated attribute can have the following values:
"true"indicates that the element iscontenteditable."false"indicates that the element cannot be edited."plaintext-only"indicates that the element's raw text is editable, but rich text formatting is disabled.
You can use theHTMLElement.isContentEditable property to test thecomputed boolean value of this property.
If the attribute is missing or its value is invalid, its value is inherited from its parent element: so the elementis editable (or not) based on the parent element.
In this article
Value
A string.
Specifications
| Specification |
|---|
| HTML> # contenteditable> |
Browser compatibility
See also
HTMLElement.isContentEditable- The
contenteditableglobal attribute.