JS 事件小结

DOM0事件覆盖

    var btn=document.getElementsByTagName('button')[0];
    btn.addEventListener('click',function(){
        console.log('event clicjk');    
    },false);
    btn.onclick=function(){
        console.log('onclick');
    }
    btn.onclick=function(){
        console.log('onclick1');
        //DOM0事件存在覆盖 这样写会覆盖前面DOM0事件  但是不会覆盖DOM2事件
    }
原文地址:https://www.cnblogs.com/cart55free99/p/3674698.html