this.style.color中的this代表什么对象?Insert title herebody {color:black}function shijian(){var li = document.getElementsByTagName("li");//返回的是一个数组for(var i=0; i

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/14 11:53:32
this.style.color中的this代表什么对象?Insert title herebody {color:black}function shijian(){var li = document.getElementsByTagName(
xSMo1+VO%˹Mā 'n&uHQA>*+ҒD(QHBe?c;ME'nxޛfƙRvItƶCv5p VtMB`[Wr?ze -CdZǦ0k`oEқ09ͻf0ZZ^5 X'4`?*vcL1'^!.9P6T /* ]l? i`Ļ]ZE*n4٬%&Clh*?K)b_6hxF{`Bá̗^]h`랈~;]LHg¡zWϘkp1؛,xT^|4Zvtt\){{w"ߗd*Fу_wto k&.f/tV h[S=4=Iy]{/d%&+(!

this.style.color中的this代表什么对象?Insert title herebody {color:black}function shijian(){var li = document.getElementsByTagName("li");//返回的是一个数组for(var i=0; i
this.style.color中的this代表什么对象?
Insert title here
body {color:black}
function shijian(){
var li = document.getElementsByTagName("li");//返回的是一个数组
for(var i=0; i

this.style.color中的this代表什么对象?Insert title herebody {color:black}function shijian(){var li = document.getElementsByTagName("li");//返回的是一个数组for(var i=0; i
this 是只本身.
这里应该指的是 整个html 文件你可以这么理解.
因为是主体在运行function
而这个主体有document
然后内部运行许多个function
问题补充:那么可以把this.style.color替换为:li[i].style.color吗?
不行的
你可以把
var li = document.getElementsByTagName("li");
换成
var li = this.document.getElementsByTagName("li");
这样理解了没
this.style.color 修改的是这里的颜色:
body {color:black}