JSFiddle - React, Tailwind, and code Playground
HTML
<div id = "mydiv">Editable content</div><p id="status"></p>
JavaScript
$(function() {
var previous = $("#mydiv").text();
$("#mydiv").click(function() { this.contentEditable = 'true'; });
$check = function() {
if ($("#mydiv").text() != previous)
$("#status").html("changed");
else
$("#status").html("same");
previous = $("#mydiv").text();
}
$(document).keyup($check);
// This is very meh
$(document).click($check);
// Work around is to check every Xs
setInterval(function() { $check(); }, 1000);
});