contenteditable

The contenteditable global attribute is an enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing.

The attribute must take one of the following values:

  • true or an empty string, which indicates that the element is editable.
  • false, which indicates that the element is not editable.

If the attribute is given without a value, like <label contenteditable>Example Label</label>, its value is treated as an empty string.

If this attribute is missing or its value is invalid, its value is inherited from its parent element: so the element is editable if its parent is editable.

Note that although its allowed values include true and false, this attribute is an enumerated one and not a Boolean one.

You can set the color used to draw the text insertion caret with the CSS caret-color property.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'contenteditable' in that specification.
Living Standard No change from latest snapshot, HTML 5.2
HTML 5.2
The definition of 'contenteditable' in that specification.
Recommendation Snapshot of HTML Living Standard, no change from HTML 5.1
HTML 5.1
The definition of 'contenteditable' in that specification.
Recommendation Snapshot of HTML Living Standard, no change from HTML5
HTML5
The definition of 'contenteditable' in that specification.
Recommendation Snapshot of HTML Living Standard, initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
contenteditableChrome Full support YesEdge Full support 12Firefox Full support 3IE Full support 5.5Opera Full support 9Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
contenteditable="caret"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes
contenteditable="events"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes
contenteditable="plaintext-only"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
contenteditable="typing"
Experimental
Chrome Full support YesEdge Full support ≤79Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also