關(guān)于this問題
function light(){
??????? var trs = document.getElementsByTagName("tr");
??????? for(var i=1;i<trs.length;i++){
???????? trs[i].onmouseover = function(){
?????? ??? ???? this.style.backgroundColor ="#f2f2f2";//這個this是指什么,trs[i]嗎?它是什么意思??
?? ??? ???? }
?? ??? ??? ?trs[i].onmouseout = function(){
?? ??? ??? ??? ?this.style.backgroundColor ="#fff";
?? ??? ??? ?}
??????? }
??? }
2016-08-29
就是你鼠標(biāo)放的那一行(比如你放在 i=2的tr上,那第三行就執(zhí)行這個函數(shù))