NatChen

Once you have chosen the road of life, you have to be brave enough to go to the end and never look back.

document.addEventListener理解

document.addEventListener("事件名称", 函数, false);


function 某函数(event){
    

       //  方法执行


}

addEventListener里最后一个参数决定该事件的响应顺序;

如果为true事件执行顺序为 addEventListener ---- 标签的onclick事件 ---- document.onclick 


如果为false事件的顺序为 标签的onclick事件 ---- document.onclick  ---- addEventListener

 

理解为其他代码的调用入口

posted @ 2017-08-01 10:19  NatChen  阅读(1472)  评论(0编辑  收藏  举报