Categories
HTML

How to make a div element editable with HTML?

Spread the love

Sometimes, we want to make a div element editable with HTML.

In this article, we’ll look at how to make a div element editable with HTML.

How to make a div element editable with HTML?

To make a div element editable with HTML, we set the contenteditable attribute.

For instance, we write

<div contenteditable="true">Anything inside this div will be editable!</div>

to set the contenteable attribute to true on the div to make its content editable.

Conclusion

To make a div element editable with HTML, we set the contenteditable attribute.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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