為什么我的代碼只能改第一行顏色,而且改了之后又改不回來了。。
? ?window.onload = function(){
? ? ? ? ? ? ? ? ??
? ? ?// 鼠標移動改變背景,可以通過給每行綁定鼠標移上事件和鼠標移除事件來改變所在行背景色。
? ? 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 ???