I want to run a function when a user edits the content of a div
with contenteditable
attribute. What\'s the equivalent of an onchange
To avoid timers and "save" buttons, you may use blur event wich fires when the element loses focus. but to be sure that the element was actually changed (not just focused and defocused), its content should be compared against its last version. or use keydown event to set some "dirty" flag on this element.