9-2編程練習(xí)中i=1,為什么從1開(kāi)始
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";
??????????????? }
????????? }
??????? }
2016-10-01
因?yàn)榈谝恍惺潜眍^不需要變色