HTML | contenteditable Attribute

It is used to specify that whether the content present in the element is editable or not. When this attribute is not set in an element, this element will inherit from its parent element.


<element contenteditable = "true|false">

Attribute: It is mainly an instance of a Global Attributes and it can be used in any HTML elements. This attribute contains two value either true or false. If the attribute value is true then content is editable and if attribute value is false the content is not editable.






<!DOCTYPE html>
        <title>contenteditable attribute</title>
            body {
            h1 {
        <h2>contenteditable attribute</h2>
        <p contenteditable="true">GeeksforGeeks: A computer science portal for geeks</p>



Supported Browsers: The browser supported by contenteditable attribute are listed below:

  • Apple Safari 3.1 and above
  • Google Chrome 4.0 and above
  • Firefox 3.5 and above
  • Opera 10.1 and above
  • Internet Explorer 6.0 and above

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.