*JS给元素注册事件的办法
<body>
<div id="good" style="height:100px; width:100px;background:#323923"></div>
<script>
document.getElementById("good").attachEvent("onclick", function() {alert("haha");});
</script>
</body>
<div id="good" style="height:100px; width:100px;background:#323923"></div>
<script>
document.getElementById("good").attachEvent("onclick", function() {alert("haha");});
</script>
</body>