JSFiddle - React, Tailwind, and code Playground
HTML
<div id="alpha" style="border:1px solid red;">
<div id="beta" contenteditable="true" style="display:inline;background-color:yellow;">Click here Click here Click here Click here</div>
</div>
CSS
:empty {
display: block;
height: 1em;
}
JavaScript
$(function() {
$("#alpha").on("click", function(e) {
console.log("click");
$(this).children().html("");
});
$("#beta").on("focusin", function(e) {
console.log("focusin");
$(this).html("");
});
});