Reconnect and disconnect a MutationObserver
问题 This question is the sequel of this one. However, it is not necessary to read the previous, I'm just giving a link for interested readers. There is an observer, which will react on every element with some class, as @Shomz suggested: var target = document.querySelectorAll(".someclass"); for (var i = 0; i < target.length; i++) { create(target[i]); } function create(t) { var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { var foo = t.getAttribute("aaa