HTML Global contenteditable Attribute

❮ Previous Global Attributes Next ❯

Example

<h1 contenteditable="false">This is an uneditable Heading.</h1>
<p contenteditable="true">This is an editable paragraph.</p>

Meaning

The contenteditable attribute allows users to directly edit content in a browser.

A value of false prevents content from being edited by users; true allows editing.

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.




Standard Syntax

<element contenteditable="true|false">



Browser Support




Status







Attribute Values

Value Description
true (It can be empty string)Specifies the element is editable.
false Specifies the element is not editable
❮ Previous Global Attributes Next ❯