DOM0级事件
1.所有的浏览器都支持
2.时间只能注册一次,后边的会覆盖旧的
3.注册
1.在html上添加
this指向自身2.匿名函数 d.onclick = function() {} this指向自身
3.普通函数 οnclick=“ok()” 相当于动态调用,this只想window,没有事件参数e的传递
DOM2级事件
IE
1.attachEvent(event,function) event要加on
2.detachEvent(event,function)
非IE
1.addEventListener(event,function,uwerCapture)
2.removeEventListener(event,function)