What is the purpose of the global contentEditable attribute in the html element?

2

In what real situation or when will it be necessary to use the global contentEditable attribute, by the html element, since this is a root element and that editing it would be the same as modifying, inserting or deleting leaf elements? Example:

<html contentEditable="true">
   ...
</html>

Thank you!

    
asked by anonymous 13.03.2016 / 20:04

1 answer

2

This means that it is possible to edit / change the content of the element.

The contentEditable attribute accepts 3 states:

  • "true" element content can be edited.
  • "false" the contents of the element can not be edited.
  • "inherit" indicates that the state is inherited from the ancestor element that has this attribute defined.

The latter case, combined with your example, makes the content of elements editable or not depending on whether you change in one place ( example ).

More information (in English) at MDN: contentEditable

    
13.03.2016 / 20:11