1.dom事件流
事件捕获=>目标元素阶段=>事件冒泡
2.addEventListener
target.addEventListener('事件类型',function(e),options|Boolean)
target.removeEventListener('事件类型',function,{capture:Boolean,mozSystemGroup:Boolean}|Boolean)
target是dom元素window或者支持事件的对象
options:{
capture:true事件捕获阶段传播到该 EventTarget 时触发
once:true时只调用一次,之后将事件移除
passive:true时不会调用 preventDefault()
mozSystemGroup:Boolean
}
第三个参数默认为false,事件在冒泡阶段执行true在捕获阶段执行