html tutorial - contenteditable Attribute in HTML - html5 - html code - html form

Contenteditable attribute in html

Learn html - html tutorial - Contenteditable attribute in html - html examples - html programs

  • The contenteditable attribute defines if the content of an element is rewrite or not.
  • The contenteditable attribute is a section of the Global Attributes.

Syntax for contenteditable attribute in HTML:

<element contenteditable="true|false">content</element>

Difference between HTML 4.01 and HTML 5 for contenteditable Attribute:

HTML 4.01

  • The contenteditable attribute has not been defined.


  • The contenteditable attribute is added newly in HTML5.

Applies To:

Element Attribute
All HTML Elements contenteditable

contenteditable Attribute Values:

Value HTML 4.0.1 HTML 5 Description
true No Yes Defines if the element is rewrite.
false No Yes Defines if the element is not rewrite.

Sample Coding for contenteditable Attribute in HTML:

Tryit<!DOCTYPE html>
        <title>Wikitechy contenteditable attribute</title>
        <p contenteditable="true">
             Wikitechy is an enhanced tutorials zone providing
             the best learning curve.                     

Code Explanation for contenteditable Attribute in HTML:

contenteditable Attribute Code Explanation

  1. <p> tag is used to defined the content in a paragraph.
  2. contenteditable is an attribute, which describes if the content of an element is edit or not. (Here the value of contenteditable is true, the content is editable.)

Output for contenteditable Attribute in HTML:

contenteditable Attribute Output

  1. The Output shows the <p> tag contents.
  2. contenteditable Attribute Output
  3. The content has contenteditable attribute, so the user can edit the content.

Browser Support for contenteditable Attribute in HTML:

4.0 6.0 3.5 3.1 10.1

Tips and Notes

  • If the contenteditable attribute is not specified on an element, the element will derive from its parent.

Related Searches to contenteditable Attribute in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.