I have a function that creates divs automatically.
How can I edit the text of this divs when I click them?*
I have tried adding the property contenteditable and set it to true:
var divTag = document.createElement("div");
divTag.contenteditable="true"
but it is not working.
*The divs are draggable, I don’t know if that affects what I need to do or not.
Any help is greatly appreciated!
Found the solution:
I created a listener for a click for every div I create dynamically and I change the text there:
divID + count is the id of my div, where count is a counter that increments every time I create a new div.