Wednesday, 1 November 2017

contentEditable Attribute in HTML5

Editable content means the content that can be edited after being loaded on the Web browser. We can make content of an HTML element as editable by using the contentEditable Attribute. The syntax to use the contentEditable Attribute  is given as follows.

Syntax :
<element contentEditable=[value] >

Here element refers to an HTML element and the contentEditable Attribute can take any of the following values:

  • True - Indicates that element is editable 
  • False- Indicates that the element is not editable 
  • inherit - Indicates that the element is also editable if it's parent is editable 
We can confirm whether an element is editable or not by using the isContentEditable attribute which returns true if the element is editable and the false if it is not.

Syntax :
element.isContentEsitable

Here the element returns true if it is editable otherwise returns false. 

No comments:

Post a Comment