<!DOCTYPE HTML>
<html>
<head>
<title>IE事件处理函数</title>
<meta charset="UTF-8">
</head>
<body>
<input type="button" id="btn" value="IE事件处理函数" />
<script type="text/javascript">
//需要调用的函数
function IEevent(){
alert("this is a IE event");
}
var btn=document.getElementById("btn");
btn.attachEvent('onclick',IEevent);//注意事件名称是onclick
</script>
</body>
</html>
哦,谢谢啊
function IEevent(){
alert("this is a IE event");
}
改为以下:
IEevent=function (){
alert("this is a IE event");
}