(一)普通的Dom事件
我们一般可以通过支持在HTML写上事件
测试
或者取到dom对象后绑定
document.getElementById(‘a').onclick=function(){alert(1)}
或者二级事件
document.getElementById(‘a').addEventListener(‘click',function(){alert(1)},flase)
或者通过script tag
(一)普通的Dom事件
我们一般可以通过支持在HTML写上事件
测试
或者取到dom对象后绑定
document.getElementById(‘a').onclick=function(){alert(1)}
或者二级事件
document.getElementById(‘a').addEventListener(‘click',function(){alert(1)},flase)
或者通过script tag