You are here: Reference > HTML > attributes > contentEditable

contentEditable attribute

Browser support:
Sets whether the contents of the object are editable.
This attribute is primarily used for creating rich text editing controls, but the contentEditable attribute allows more than just text editing, the user can edit all content within this control.
Firefox only supports the contentEditable attribute since version 3. If you need similar functionality in the older versions of Firefox, use the designMode property.
Note: the contentEditable attribute does not have any effect for disabled elements (DISABLED attribute).
Child elements that have layout inherit the value of the contentEditable attribute, so if you want to place a non-editable element within an editable one, you must set the contentEditable attribute to false.
JavaScript page for this attribute: contentEditable. You can find other example(s) there.

Possible values:

String that sets the type of the editability.
One of the following values:
Default. Inherited from object's parent.
Contents are not editable.
Content are editable.
Default: inherit.

Example HTML code 1:

This example illustrates the use of the contentEditable attribute:
<div contenteditable="true">Edit this text!</div>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content