HTML | contenteditable Attribute
It is used to specify 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.
Syntax:
<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 the content is editable and if the attribute value is false the content is not editable.
Example:
<!DOCTYPE html> <html> <head> <title>contenteditable attribute</title> <style> body { width:60%; text-align:center; } h1 { color:green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>contenteditable attribute</h2> <p contenteditable="true">GeeksforGeeks: A computer science portal for geeks</p> </body> </html> |
Output:

Supported Browsers: The browser supported by contenteditable attribute are listed below:
- Google Chrome 4.0
- Internet Explorer 6.0
- Firefox 3.5
- Opera 10.1
- Safari 3.1
Recommended Posts:
- HTML | min Attribute
- HTML | <map> name Attribute
- HTML | dir Attribute
- HTML | <img> src Attribute
- HTML | <li> value Attribute
- HTML | value Attribute
- HTML | for Attribute
- HTML | <img> alt Attribute
- HTML | low Attribute
- HTML | <a> rel Attribute
- HTML | accesskey Attribute
- HTML | onscroll Attribute
- HTML | start Attribute
- HTML | oncut Attribute
- HTML | <meter> value Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. 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.



