📜  关于内联样式更改 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:14.550000             🧑  作者: Mango

代码示例1
var observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutationRecord) {
        console.log('style changed!');
    });    
});

var target = document.getElementById('myId');
observer.observe(target, { attributes : true, attributeFilter : ['style'] });