How to make editable div or paragraph by double clicking?

45 views   Javascript  2020.09.19

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?

Answers, ideas and Comments

» 1 idea

gadrawin • 2 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



In order to go deep, share any relevant idea or posting solution to some questions, You have to sign in or create a new account if you don't have one. And get Donnekted(connected)

Log in now  Join the Team

This site is for sharing topics, questions, answers, experiences or other contents related to different stuffs, especially technology. For existing users, They can make any topic(post) to discuss about in hope for ideas or any result from other people from different communities. In order to get involved, Get donnekted(connected) by Joining us here!

Posted under this group »
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