Is it possible to fire an event when the innerHTML of a changes?
I am using YUI 3.
Thanks!
Is it possible to fire an event when the innerHTML of a changes?
I am using YUI 3.
Thanks!
There is no out of the box onchange event for divs. If you want this you are going to have write this yourself (with a timer and storing whats the current value etc).
I would however try to take it a step back and call a method when you change the innerValue of that div to take care of ... w/e.
Use a setter:
myDiv.__defineSetter__("innerHTML",
function(newHTML) {
...
}
);
I think Fabian's right in that you'll need to user a timer and compare the value.
That being said, the right way to do this in YUI3 would be to define a synthetic DOM event using later.