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.