this.style.backgroundColor中的this指的是哪個(gè)對(duì)象
window.onload = function(){
?????????? var trs = document.getElementsByTagName('tr');
?????????? for(var i = 1; i < trs.length; i++){
??????????????
??????????????? trs[i].onmouseover = function(){
???????????????????? this.style.backgroundColor = "pink";
??????????????? }
??????????????? trs[i].onmouseout = function(){
???????????????????? this.style.backgroundColor = "#fff";
??????????????? }
????????? }
??????? }
2016-08-05
this 確切的說(shuō)是指在當(dāng)前function()作用域中,trs[i] 循環(huán)的當(dāng)前的這個(gè) i 對(duì)象。我是這么理解的。
2016-08-04
this翻譯過(guò)來(lái)的意思就是‘這個(gè)’,,函數(shù)作用的對(duì)象是啥this就是啥
2016-08-04
this 指的是?trs[i] 這個(gè)對(duì)象。是當(dāng)前function()作用域的對(duì)象。?
2016-08-04
this--》 trs[i] ??