javascript 监测属性变化事件

var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutationRecord) {
console.log(mutationRecord);
}); 
});

var target = parent.document.getElementById('AAAssetCategory-link');
observer.observe(target, { attributes : true, attributeFilter : ['class'] });

 

posted @ 2020-04-03 17:27  wolbo  阅读(527)  评论(0编辑  收藏  举报