Listening to changes of contenteditable
suggest changechange does not fire for a contenteditable element. keydown and keyup do. keypress is deprecated. The input event fires when the contents change, including changes that do not come from the keyboard. contenteditableHtmlElement below is an element whose contenteditable attribute is set:
contenteditableHtmlElement.addEventListener("input", function() {
console.log("contenteditable element changed");
});
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents