Div with contentEditable does not work at all


I want to allow user to edit some div.

I have this code snippet:

   <div contenteditable="true">Click to Edit me</div>

Is there any explanation why it’s not editable on click?

Here’s a codepen.



Your codepen works for me in unless I misunderstood your issue.


@gmarziou I bet you didn’t try with Safari :wink:

I’ve just succeeded:

<div contenteditable="true" style="-webkit-user-select: text; -khtml-user-select: text;-moz-user-select: text;-o-user-select: text;user-select: text;">

This way it works on Safari and others too.

Yes I was on Chrome or Firefox

when i press Enter, the text in the newline can’t be selected. do you have the same issue?