确实是老师讲错了,dom0级不能给元素添加多个事件,如果添加了多个事件,则只会执行最后添加的那个事件;dom2可以给元素添加多个事件,而且会按顺序进行
2017-11-14
已采纳回答 / qq_会长大的幸福_4
as是个数组,也就是对象,不能确定到具体元素上,给一个对象设置背景色显然是不成立的,而as[i]已经具体到了某个变量,这个变量所表示的就是某个具体的元素,给某个元素设置背景色是合理的
2017-10-31
clearInterval(timer); var that=this; that.style.backgriund="#999"; stop.onclick=stopFun; function stopafUN(){CLEARinterval(timer); play.style.bckground="#036; } document.onkeyup=function(event){var event=event||window.event; if(event.keycode==13){if(flag==0){playfun(); flag=1;}else{stopfun(); }}}
2017-10-30
<dody><div id="title class="title>choujiang辣</div><div class="btns> <span id="stop>开始</span><span id="play>结束</span></div><link type="text/css rel="stylesheet href="css/style.css " *{margin:0,padding:0; } title{width:400px; height:70px; margin:0 auto; padding-top:30px; text-algin:center;
2017-10-30
getclass("select-text,id)[0].innerHTNL; e=E||WINDOW; if(e.stoppropagation){e.stoppropagation()}else{e.cancelBabble=true;} loginstartshow.className="; loginstartshow.className="login-state-show"+id; document.onclick=function(){ul.style.display=none;}
2017-10-30
lis[i].onmouseover=function(){ lis[i this.style.background="#999;} lis[i].mouseout=function(){this.style.background="#fff";} lis[i].onclick=function(){loginstate.style.display="none";//ul var id=thid.id; tex.innerHTML=getclass(")} //show =document.getelemtntbyid("show); tex.innerHTMLgetclass
2017-10-30
var logins=document.getelemtnbyid("loginstart), ulst=document.getelemtnbyid("loginstatrpanel);
lis=ulli.getelemtntbytagname("li); tex=docuemnt.getelemtntbyid("login2qq-start-tex); logins.onclick=function(){ulli.style.display="block;} for(var i=0; i<li.length; i++){li[i].onmouseover=function()}
lis=ulli.getelemtntbytagname("li); tex=docuemnt.getelemtntbyid("login2qq-start-tex); logins.onclick=function(){ulli.style.display="block;} for(var i=0; i<li.length; i++){li[i].onmouseover=function()}
2017-10-30