Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOMsubtreemodified equivalent in IE

Does anyone know the equivalent of this event in IE ?

Or may be a way around for this logic:

  document.addEventListener("DOMSubtreeModified", function (e) {
            if ($(e.target).hasClass("myclass")) {
                var getId= e.target.id;
            }
        }, false)

This works fine in FF, Chrome, Safari, IE 9 or higher.

Need an equivalent logic for IE8 and IE7

like image 516
Ani Avatar asked Nov 08 '13 22:11

Ani


1 Answers

I had a similar problem (though I was using jQuery). I solved it by using the following

//chrome / ff
$(".myClass").on("DOMSubtreeModified", function() {
//do stuff
});     

//i.e.
$(".myClass").on("propertychange", function() {
//do same stuff 
});     

This can be further combined into a single event listener

$('.myClass').on('DOMSubtreeModified propertychange', function() {
    // do stuff
});
like image 62
JJones Avatar answered Nov 02 '22 10:11

JJones