Web4College

HTML contenteditable attribute

HTML Contenteditable attribute allows the user to edit the content. Every element can use this attribute.

Example
Try it
<div contenteditable>
  The content inside every html element is editable because of 'contenteditable' attribute.
  By default, div element is not editable . But it becomes editable by the contenteditable attribute.
</div>
The content inside every html element is editable because of 'contenteditable' attribute. By default, div element is not editable . But it becomes editable by the contenteditable attribute.

Related Tags

The tags that support contenteditable attribute

<div> tag

div element is a block of content usually used to style the content.

Example
Try it
<div contenteditable>
  This is a block of content and it is editable. It is the last priority of authors to write the content. It is used to style the content. 
 </div>

<p> tag

div element is a block of content usually used to style the content.

Example
Try it
<p contenteditable>
This is a paragraph that is editable. We can add more text.
</p>

<section> tag

contenteditable attribute applies to all the child elements. In the following example, contenteditable is applied on the section element and all the child elements of section element become editable.

Example
Try it
<div contenteditable>
  This is a block of content and it is editable. It is the last priority of authors to write the content. It is used to style the content. 
 </div>