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 December 2021.

* Some parts of this feature may have varying levels of support.

The contentEditable property of the HTMLElement interface specifies whether or not the element is editable.

This enumerated attribute can have the following values:

  • "true" indicates that the element is contenteditable.
  • "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 the HTMLElement.isContentEditable property to test the computed 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 element is editable (or not) based on the parent element.

Value

A string.

Specifications

Specification
HTML Standard
# contenteditable

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
contentEditable
plaintext-only as a value

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also