DOM二级事件 发表于 2017-04-20 DOM二级事件 W3C 标准——addEventListener 语法: addEventListener(‘事件’,’函数’,’冒泡/捕捉’) 绑定多个事件123//html<input type="button" id="test1" value='增加'><input type="button" id="test2" value='删除'> 123456789101112//js//绑定多个事件按顺序执行var aa = 0;var increment = function(){console.log(a++)}var decrement = function(){console.log(a--)}test1.addEventListener('click',increment);test1.addEventListener('click',decrement);//删除绑定事件test2.onclick = function(){ test1.removeEventListener('click',increment);} 捕捉与冒泡