HTML contenteditable Attribute

 

Definition and Usage

The contenteditable attribute is a global attribute. This attribute is new in HTML5. Means, this attribute does not work in the previous versions of HTML.
It specifies whether the element content is editable or not.
It allows the user to edit the content of an element.

There are two values can be set of the contenteditable attribute.

1) true : The true value specifies that the element is editable.

2) false : The false value specifies that the element is not editable.

Example :

<p contenteditable="true">This is an editable paragraph, click to edit.</p>

<p contenteditable="true">This is not editable paragraph. You can't edit it</p>
Result

This is an editable paragraph, click here to edit.


This is not editable paragraph. You can’t edit it

 

Here are a few tutorials for you to read next:

If you find this tutorial helpful, then please Subscribe to our YouTube Channel for video tutorials, and share this article on social media.

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes0
No0
Powered by Devhats

Leave a Comment

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