Why does MutationObserver fire twice for childList but never for characterData?
问题 I have a simple MutationObserver setup as a test. The HTML has a span whose text content gets updated once per second (and a div for messages): <span class="tester"></span> <div id="msg"></div> The MutationObserver is set to watch .tester and writes text to the #msg div when it observes a change. Meanwhile, a setInterval() runs once/second to change the text in .tester : var target = document.querySelector('.tester'); var observer = new MutationObserver(function(mutations) { mutations.forEach