这段代码有问题吗?
window.onload = function()
{
var tr=document.getElementsByTagName("tr");
for(var i=0;i<tr.length;i++)
{
tr[i].onmouseover=function(){
tr[i].style.backgroundColor="#f2f2f2";
}
tr[i].onmouseout=function(){
tr[i].style.backgroundColor="#fff";
}
}
}