JSFiddle - React, Tailwind, and code Playground
by rakeshjack
HTML
<div>Some text</div><br><br>
<div>
Some text more
</div>
<div>
Some more textbdg
</div>
<button>Toggle editable</button>
CSS
.editable {
background: #EAEAEA
}
JavaScript
$('button').click(function() {
var $div = $('div'),
isEditable = $div.is('.editable');
$('div').prop('contenteditable', !isEditable).toggleClass('editable')
})