JSFiddle - React, Tailwind, and code Playground
HTML
<div class="editor" contenteditable="true">awdawd</div>
CSS
.editor {
border: 2px solid black;
padding: 20px;
}
.editorchange {
background: red;
width: 100%;
}
JavaScript
jQuery('.editor').on('input propertychange paste change', function() {
$(this).addClass("editorchange");
});