How to make editable div or paragraph by double clicking?

I want to make a simple div which has to become editable when a user double-clicks on it. I wish div to turn into element like text field with cursor to the text where double-click event occurred. Moreover, I want it to turn back into <div> after pressing Enter button. How to hack it?

»Javascript @ahsafudari



» 1 answer  » 46 views   1 like


Add photos






Gadrawin • 3 weeks ago
Dear anonymous, There is a simple answer and good way to hack it. We can handle this by using focus and blur events, I hope you know them. My example: Suppose you have a div with id=view



 »

0  Dislike  •  Reply



Back to top

[SHARE THIS POST]: The post's archived Spread it to others!

Posted under this donnektish »
This community is about sharing contents such as questions and answers discussing about Javascript and TypeScript, ES5, ES6
66 people joined this donnektish



Maintain social distancing, to avoid Covid19