onclick="clearinfo(this) 中的this代表什么意思(有人說(shuō)它指代標(biāo)簽a,但在body有好幾個(gè)標(biāo)簽a?。?/h1>
向日葵一族
2016-12-12 07:29:12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無(wú)標(biāo)題文檔</title><script>function changewebsize(){?? ?document.getElementById("webSite").innerHTML="<a ;?? ?}?? ? function clearinfo(obj){?? ??? ??? ??? ? obj.value="";?? ??? ? obj.style.color="black";?? ??? ? }</script></head><body><div id="webSite"><a >百度</a></div><input type="button" value="改變層內(nèi)容"? onclick="changewebsize()" /><br /><br /><input type="text" name="city" value="請(qǐng)選擇您工作的城市" onclick="clearinfo(this) " class="wordstext"/> <input type="text"? name="city" value="請(qǐng)選擇您工作的第二志愿城市" onclick="clearinfo(this)" class="wordstext" /><br /><br /><input type="text" name="city" value="請(qǐng)選擇您工作的城市"? onclick="clearinfo(this) " class="wordstext"/> <input type="text"? name="city" value="請(qǐng)選擇您工作的第二志愿城市"? onclick="clearinfo(this) " class="wordstext" /><br /><br /><input type="text" value="顯示上面的input所有內(nèi)容"?? onclick="clearinfo(this) " class="wordstext" /> <input type="text" value="顯示所有城市所有內(nèi)容" onclick="clearinfo(this) " class="wordstext"/> </body></html>
8 回答

慕的地6079101
TA貢獻(xiàn)3593條經(jīng)驗(yàn) 獲得超0個(gè)贊

MicleZhou
TA貢獻(xiàn)6條經(jīng)驗(yàn) 獲得超12個(gè)贊
this指的是當(dāng)前事件所在標(biāo)簽上對(duì)應(yīng)的元素對(duì)象。
添加回答
舉報(bào)
0/150
提交
取消