var target = document.querySelector('.some-class'); var observer = new MutationObserver(function(mutations) { if (mutations[0].target.classList.contains("some-child-class")) { // Do something } } var config = { subtree: true, characterData: true, childList: true }; observer.observe(target, config);
Тут могла быть ваша реклама.