W3Schools.com

HTML5 contenteditable Attribute

HTML5 Global Attributes HTML5 Global Attributes

Example

An editable paragraph:

<p contenteditable="true">This is an editable paragraph.</p>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The contenteditable attribute is supported in all major browsers.


Definition and Usage

The contenteditable attribute specifies whether the content of an element is editable or not.


Differences Between HTML 4.01 and HTML5

The contenteditable attribute is new in HTML5.


Syntax

<element contenteditable="true|false|inherit">

Attribute Values

Value Description
true Specifies that the element is editable
false Specifies that the element is not editable
inherit Specifies that the element is editable if its parent is


HTML5 Global Attributes HTML5 Global Attributes
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE