亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

onclick="clearinfo(this) 中的this代表什么意思(有人說它指代標簽a,但在body有好幾個標簽a?。?/h1>

<!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>無標題文檔</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="改變層內容"? onclick="changewebsize()" /><br /><br /><input type="text" name="city" value="請選擇您工作的城市" onclick="clearinfo(this) " class="wordstext"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text"? name="city" value="請選擇您工作的第二志愿城市" onclick="clearinfo(this)" class="wordstext" /><br /><br /><input type="text" name="city" value="請選擇您工作的城市"? onclick="clearinfo(this) " class="wordstext"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text"? name="city" value="請選擇您工作的第二志愿城市"? onclick="clearinfo(this) " class="wordstext" /><br /><br /><input type="text" value="顯示上面的input所有內容"?? onclick="clearinfo(this) " class="wordstext" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" value="顯示所有城市所有內容" onclick="clearinfo(this) " class="wordstext"/>&nbsp;&nbsp;&nbsp;&nbsp;</body></html>
查看完整描述

8 回答

已采納
?
串豬神

TA貢獻155條經驗 獲得超200個贊

點擊的那個元素

查看完整回答
6 反對 回復 2016-12-12
?
慕虎8944357

TA貢獻4條經驗 獲得超2個贊

this ?一般用于指定選擇的是當前對象

查看完整回答
1 反對 回復 2016-12-13
?
一只廢喵

TA貢獻8條經驗 獲得超4個贊

個人理解 ,就是你代碼里將要執行的函數名或者按鈕或者什么的,有毛病望指出。
查看完整回答
反對 回復 2016-12-12
?
Guard丿星魂

TA貢獻18條經驗 獲得超1個贊


點的哪個A標簽就是那個A標簽

查看完整回答
反對 回復 2016-12-12
?
MicleZhou

TA貢獻6條經驗 獲得超12個贊

this指的是當前事件所在標簽上對應的元素對象。

查看完整回答
反對 回復 2016-12-12
?
云天河V

TA貢獻17條經驗 獲得超8個贊

點擊的誰就是誰,你可以看看他們的索引值

查看完整回答
反對 回復 2016-12-12
?
慕UI8820655

TA貢獻15條經驗 獲得超4個贊

你的這個this相當于input,你點擊那個input

查看完整回答
反對 回復 2016-12-12
?
cleartime

TA貢獻7條經驗 獲得超0個贊

事件里面的this是指點擊的元素,建議看看犀牛書入門

查看完整回答
反對 回復 2016-12-12
?
self_potato

TA貢獻53條經驗 獲得超27個贊


指代當前點擊元素

查看完整回答
反對 回復 2016-12-12
  • 8 回答
  • 0 關注
  • 3718 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號