let node = document.body; // or document.getElementById('nodeid')
                var mutationObserver = new MutationObserver(function(mutations) {
                  mutations.forEach(function(mutation) {
                    console.log(mutation);
                  });
                });
                // Starts listening for changes in the root HTML element of the page.
                //mutationObserver.observe(document.documentElement, {
                mutationObserver.observe(node.parentNode, {
                    attributes: true,
                  characterData: true,
                  childList: true,
                  subtree: true,
                  attributeOldValue: true,
                  characterDataOldValue: true
                });

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-07-31
  • 2021-10-17
猜你喜欢
  • 2021-04-14
  • 2021-11-26
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案