函数封装问题
window.onload = function(){
var tr=document.getElementsByTagName("tr");
for(var i= 0;i<tr.length;i++)
{
bagChange(tr[i]);
}
}
function bagChange(abj){
abj.onmouseover=function(){
this.style.backgroundColor="#f2f2f2";
}
abj.onmouseout=function(){
this.style.backgroundColor="#fff";
}
}
在这里面,我讲abj换成tr[i]就不行了,这是为什么