日期:2014-05-16 浏览次数:20513 次
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>eventObject</title>
</head>
<body>
<input type="button" id="myBtn" value="clickMe" />
<input type="button" id="myRemoveBtn" value="remove event handler" />
<script type="text/javascript">
var btn = document.getElementById("myBtn");
btn.attachEvent("onclick",function(){
alert("clicked");
});
</script>
</body>
</html>