onchange contenteditable code example
Example: contenteditable onchange
<!-- Use an "input" event listener -->
<div contenteditable="true" id="editor">Please type something in here</div>
<script>
document.getElementById("editor").addEventListener("input", inputEvt => {
console.log("input event fired");
}, false);
</script>