HTML contenteditable Attribute


ATTENTION: THIS PAGE IS Valid HTML 5 AND IS BEST VIEWED WITH HTML 5 - Please upgrade your browser or download one of the HTML 5 compatible browsers such as Mozilla Firefox, Chrome, Opera or IE 9 (March 14, 2011 or later). For more information see HTML 5 browsers.

If you find this helpful, please click the Google +1 Button to the left, if it is white, to make it turn blue or red. Thank you! (It also helps find this page again more easily.)

PDF mobile

The contenteditable attribute in HTML

Make sure you understand the difference between an attribute and property and are familiar with the definitions of other HTML terms.

The contenteditable attribute is an enumerated attribute, not a boolean attribute. There are four possible ways to code the contenteditable attribute to set the contenteditable property of an element:

  1. omit the contenteditable attribute, in which case the value of the contenteditable property will be inherited
  2. contenteditable="", which sets the contenteditable property to true
  3. contenteditable="true", which sets the contenteditable property to true
  4. contenteditable="false", which sets the contenteditable property to false

All other values are not valid.

Valid HTML 5