I am in IE 9 and I call:
document.attachEvent('onpropertychange', function(){
console.log("triggered");
});
in the console which returns true.
Then I change an attribute:
$('div').eq(0).attr("data-url", "url");
which changes the attribute but does not print triggered to the console. What am I doing wrong?
According to MSDN, this event does not bubble, so placing the handler on the
documentwouldn’t observe property changes ondivelements.Also, I’m not certain that a change to a sub property of
element.datasetwould trigger the hander. Worth testing I suppose.