How to execute a JS method on any DOM change in the HTML page at runtime

You need to bind a function to the DOMSubtreeModified mutation event:

$(document).bind('DOMSubtreeModified', function () {
    <Code to Execute>
 });

If your target browsers support it, you should use a MutationObserver instead.

Leave a Reply