Home / Web Development / HTML / Making content editable – HTML

Making content editable – HTML

In HTML page we can edit any document. The javascript helps to overcome this problem. The contenteditable attribute helps whether the content of an element is editable or not.
In contenteditable attribute there are three values are available. They are TRUE, FALSE, INHERIT.

contenteditable=”” or contenteditable=”true”
Indicates that the element is editable.
contenteditable=”false”
Indicates that the element is not editable.
contenteditable=”inherit”
Indicates that the element is editable if its immediate parent element is editable. This is the default value.

Syntax

Attribute Values

Value Description
true Specifies that the element is editable.
false Specifies that the element is not editable

Simple Example

Here’s the above HTML in action:

Test

This text can be edited by the user.

The contentEditable attribute is very easy method. If the contentEditable attributes is set as true that shows the HTML elements will become editable.

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social Media Auto Publish Powered By : XYZScripts.com