為什么我的代碼只能改第一行顏色,而且改了之后又改不回來(lái)了。。
? ?window.onload = function(){
? ? ? ? ? ? ? ? ??
? ? ?// 鼠標(biāo)移動(dòng)改變背景,可以通過(guò)給每行綁定鼠標(biāo)移上事件和鼠標(biāo)移除事件來(lái)改變所在行背景色。
? ? var tr=document.getElementsByTagName("tr");
? ? for(i=0;i<tr.length;i++){
? ? ? ? tr[i].onmouseover=function(){
? ? ? ? ? ? tr[i].style.backgroundColor="#f2f2f2";
? ? ? ? };
? ? ? ? a_list[i].onmouseout=function(){
? ? ? ? ? ? tr[i].style.backgroundColor="#fff";
? ? ? ? };
? ? }
2017-06-06
a_list ???