VOOZH about

URL: https://www.geeksforgeeks.org/html/html-contenteditable-attribute/

⇱ HTML contenteditable Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML contenteditable Attribute

Last Updated : 11 Jul, 2025

The HTML contenteditable attribute determines if element content is editable. It defaults to inheriting from the parent element. As a global attribute, it allows versatile content manipulation within the webpage directly.

Syntax

<element contenteditable = "true|false">

Supported Tags

It supports all HTML elements. 

Attribute Value

A contenteditable attribute is mainly an instance of a Global Attribute and it can be used in any HTML element. This attribute value contain the following values:

Attribute ValueDescription
true or empty stringIndicates the element is editable.
falseIndicates the element is not editable.
plaintext-onlyIndicates the raw text of the element is editable, while rich text features are disabled.

HTML contenteditable Attribute Examples

Example 1: In this example we use contenteditable attribute enables editing within specified elements. Here, a paragraph is made editable, allowing direct manipulation of its text content.

Output:


👁 contenteditableAttribute
HTML contenteditable Attribute example output

Example 2: In this example we use contenteditable attribute allows direct editing of specified elements. Here, paragraphs are made editable with "true" and "plaintext-only" values, enabling text manipulation within the webpage.

Output:

👁 contenteditableAttribute2
HTML contenteditable Attribute example output

Supported Browsers

The browser supported by contenteditable attribute are listed below: 

Comment
Article Tags: