JSFiddle - React, Tailwind, and code Playground
by Victor
HTML
<div class="content" tabindex="0" contenteditable='true'>this is a div</div>
<button type="button" class="trigger">trigger</button>
JavaScript
var content = document.querySelector('.content');
var trigger = document.querySelector('.trigger');
var isEditable = content.isContentEditable;
trigger.onclick = function(){
alert('fired');
if(isEditable){
content.focus();
alert('passed')
}else {
alert('did not pass')
};
};
//on load
//content.focus();