zoukankan      html  css  js  c++  java
  • 监控节点属性变换

    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
                    });
  • 相关阅读:
    .editorconfig
    每日日报
    每日日报
    每日日报
    每日日报
    每日日报
    《大道至简》读后感
    每日日报
    每日日报
    每日日报
  • 原文地址:https://www.cnblogs.com/zyip/p/14124294.html
Copyright © 2011-2022 走看看