Good day.

The question is, failed to google.

Is there any way to track content changes in tags? What event, maybe?

Or it remains, as a cross-browser option, when loading to place the contents of an element into a variable and after some time constantly check whether it has changed?

    1 answer 1

    You can look towards DOMSubtreeModified , which tracks the structural changes of the descendants of an element.

    var testDiv = $('#test'); var counter = 0; testDiv.bind("DOMSubtreeModified",function(){ console.log('изменилось'); }); setInterval(function(){ testDiv.append('<p>text' + (counter++) + '</p>'); }, 1000); 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="test"></div> 

    There is also DOMNodeInserted , DOMNodeRemoved , DOMAttrModified and DOMCharacterDataModified


    But in IE below version 9 this is all not available.