监听元素的属性改动js
作者:互联网
function onStyleChange(){ alert(document.getElementById('digistat').className); } function onIeChange(p){#可以添加的按钮onchange事件 if(event.propertyName == 'digistaterr'){ onStyleChange(); } } if(window.MutationObserver){ var observer = new MutationObserver(function(mrs){ if(mrs[0].attributeName == 'class') onStyleChange(); }); observer.observe(document.getElementById('digistat'), { 'attributes': true }); }
标签:function,改动,observer,onStyleChange,digistat,js,MutationObserver,document,监听 来源: https://www.cnblogs.com/ghl666/p/12956436.html