<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>111</div>
<script>
var div = document.getElementsByTagName("div")[0];
div.onclick = fn;
function fn() {
alert(1);
}
//第二种属性绑定
// div["onclick"] = function () {
// alert(2);
// }
// console.log(div.onclick);
// console.log(div.onmouseover);
div.removeEventListener("click",fn);
</script>
</body>
</html>
listener
网友评论