Global Attributes

HTML contenteditable attribute

Build a form with the HTML form generator

Makes an element editable, disables editing, or requests plain-text editing. The missing or invalid value inherits the parent editing state. This is not a form input and changes are not automatically submitted. Applicability: global HTML attribute, subject to element-specific restrictions and browser support. The empty string is equivalent to true. plaintext-only requests plain-text editing rather than rich formatting; check the target browsers. For an editing host, provide a visible instruction or accessible label and an explicit way to save the edited text.

Formal Syntax & Structure

html syntaxhtml
contenteditable="true"

Parameters & Attributes

NameTypeDescription
contenteditableenumerated: empty, true, false, plaintext-onlyEmpty and true enable editing; false disables editing; plaintext-only requests plain-text editing. Missing or invalid values inherit.

Working Example

Example Snippethtml
<div contenteditable="true" aria-label="Draft note">Edit this note.</div>

Browser Compatibility

Minimum supported versions across modern rendering engines

Widely Available
Chrome
1
Yes
Edge
12
Yes
Firefox
3
Yes
Safari
≤4
Yes
Opera
9
Yes
Checked desktop BCD snapshot: global contenteditable attribute. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted. Base editing support only; plaintext-only has its own support row.
HTML Living Standard
HTML Reference