weibo_一万群什麼_0
2016-05-24 09:11
window.onload = function(){
var trs = document.getElementsByTagName('tr');
for(var i = 1; i < trs.length; i++){
trs[i].onmouseover = function(){
this.style.backgroundColor = "#f2f2f2";
}
trs[i].onmouseout = function(){
this.style.backgroundColor = "#fff";
}
}
}这个函数为什么要时候for循环遍历一次?
给每一行添加事件效果,没有for循环的话,要给哪个加呢
JavaScript进阶篇
469185 学习 · 22584 问题
相似问题