麻烦帮我看看代码到底是哪里出错了呢?
<script> window.onload=function (){ var login_btn=Document.getElementById('login'), login_box=Document.getElementById('login_box'), close=Document.getElementById('close'); function addEvent (ele,type,handler){ if (ele.addEventListener){ ele.addEventListener(type,handler,false) }else if (ele.attachEvent) { ele.attachEvent('on'+type,handler) }else{ ele['on'+type]=handler; } } function showLogin () { login_box.style.display='block'; } function hideLogin () { login_box.style.display='none' ; } addEvent(login_btn,'click',showLogin); addEvent(close,'click',hideLogin); } </script>
哪里错了呢,麻烦大神帮指出来