为什么不能运行啊
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>事件流</title>
</head>
<body>
<div id="box">
<input type="button" value="按钮" id="btn" onclick="showMes()"/>
<input type="button" value="按钮2" id="btn2"/>
<input type="button" value="按钮3" id="btn3"/>
</div>
<script type="text/javascript">
function showMes(){
alert("Hello");
}
var btn2=document.getElementById("btn2");
var btn3=document.getElementBtId("btn3");
btn2.onclick=function(){
alert("这是通过DOM0级添加的事件");
};
//btn2.onclick=null;
btn3.addEventListener("click",showMes,false);
btn3.addElementListener("click",function(){
alert(this.value);
},false);
//btn3.removeElementListener('click',showMes,false);
//btn3.attachEvent('onclick',showMes());
var eventUtil={
//添加句柄
addHandler:function(element,type,handLer){
if(element.addEventListener){
element.addEventListener(type,handLer,false);
}else if(element.attachEvent){
element.attachEvent("on"+type,handLer);
}else{
element["on"+type]=handLer;
}
},
removeHandler:function(element,type,handler){
if(element.removeEventListener){
element.removeEventListener(type,handler,false);
}else if(element.detachEvent){
element.detachEvent("on"+type,handler);
}else{
element["on"+type]=null;
}
}
};
//eventUtil.addHandler(btn3,"click",showMes);
//eventUtil.removeHandler(btn3,"click",showMes);
</script>
</body>
</html>