contenteditable Attribute:
ContentEditable attribute provides the user to edit the content of html element. If the attribute is present and its value is true user can easily edit content of an html element and if value is false user cannot edit the content.
Syntax:
<element contenteditable="true|false">
Attribute Value:
Value |
Description |
true |
Indicates that the element is editable |
false |
Indicates that the element is not editable |
Example:
<!DOCTYPE html>
<html>
<body>
<p contenteditable="true">This is a paragraph. It is editable. Try to change this text.</p>
<p contenteditable="false">This is a paragraph. It is editable. Try to change this text.</p>
</body>
</html>
In the above example the first <p> tag content is editable as its value (contenteditable="true") is true and the second <p> tag content is not editable as its value is false(contenteditable="false").
0 Comment(s)