//监听元素
var targetNode = $("#div")[0]
var targetNodechange = {attributes: true};
function callback(mutationsList,observer){
//目标元素发生变化时执行的代码
}
var mutationObserver = new MutationObserver(callback);
mutationObserver.observe(targetNode,targetNodechange);
//停止监听
mutationObserver.disconnect();
11-26
05-11