Listening to changes of contenteditable
suggest changeEvents that work with most form elements (e.g., change, keydown, keyup, keypress) do not work with contenteditable.
Instead, you can listen to changes of contenteditable contents with the input event. Assuming contenteditableHtmlElement is a JS DOM object that is contenteditable:
contenteditableHtmlElement.addEventListener("input", function() {
console.log("contenteditable element changed");
});
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents