为啥1行2不行呢
1:
/* window.onload = function(){
var hang=document.getElementsByTagName('tr');
for(var i=0;i<hang.length;i++){
bdc(hang[i]);
}
}
function bdc(can){
can.onmouseover=function(){
can.style.backgroundColor="#f2f2f2";
}
can.onmouseout=function(){
can.style.backgroundColor="#fff";
}
}*/
2:
window.onload = function(){
var hang=document.getElementsByTagName('tr');
for(var i=0;i<hang.length;i++){
hang[i].onmouseover=function(){
hang[i].style.backgroundColor="#f2f2f2";
}
hang[i].onmouseout=function(){
hang[i].style.backgroundColor="#fff";
}
}
}