<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>IE事件流</title>
<!--
针对IE8及其以前的IE版本
添加事件:attachEvent(event,function);
移除事件:detachEvent(event,function);
tips:
IE中匿名函数内的this===window
DOM2级事件跟DOM0级事件一样要加on
-->
</head>
<body>
<button id="btn">点击</button>
<script>
var btn=document.getElementById("btn");
function tan1(){
alert("弹框1");
}
function tan2(){
alert("弹框2")
}
btn.attachEvent("onclick",tan1);//后弹出
btn.attachEvent("onclick",tan2);//先弹出
</script>
</body>
</html>