Listening to changes of contenteditable

suggest change

Events 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");
});

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents