W3cubDocs

/Web APIs

HTMLElement: contentEditable property

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.
  • 'inherit' indicates that the element inherits its parent's editable status.

You can use the HTMLElement.isContentEditable property to test the computed boolean value of this property.

Value

A string.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
contentEditable 1 12 3 5.5 9 3 4.4 18 4 10.1 1 1.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable