課程
/前端開發
/HTML/CSS
/初識HTML(5)+CSS(3)-升級版
密碼:for="pass"有什么作用啊
2018-01-31
源自:初識HTML(5)+CSS(3)-升級版 6-1
正在回答
一般來說用于表單的input輸入內容的標題,for就是綁定的input的id,如果不要for,就只是普通的標簽,有了for且綁定了input的id,那么當你鼠標點擊label內容時也可以focus在綁定的input上,你可以試試。
你平常輸入表單肯定習慣點擊的input,對吧?
正如3樓所言
規定lable與哪個表單元素綁定
給你查了一下
for 屬性規定 label 與哪個表單元素綁定。
?<label for="male">Male</label> ?<input type="radio" name="sex" id="male" /> ?<br /> ?<label for="female">Female</label> ?<input type="radio" name="sex" id="female" />
類似于 title 吧? 起一個說明作用?? 沒什么大用? 不要糾結這個
有大用
舉報
HTML(5)+CSS(3)基礎教程8小時帶領大家步步深入學習標簽用法和意義
4 回答for=“pass”
1 回答label與label for
2 回答label和label for
2 回答<form method="past" action="save.php"> <label for="username">用戶名:</label> <input type="text" name="username" id="username" value="" /> <label for="pass">密碼:</label> <input type="password" name="pass" id="pass" value="" />
7 回答label標簽與label for 有什么區別
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-01-31
一般來說用于表單的input輸入內容的標題,for就是綁定的input的id,如果不要for,就只是普通的標簽,有了for且綁定了input的id,那么當你鼠標點擊label內容時也可以focus在綁定的input上,你可以試試。
你平常輸入表單肯定習慣點擊的input,對吧?
正如3樓所言
2018-01-31
規定lable與哪個表單元素綁定
2018-01-31
給你查了一下
for 屬性規定 label 與哪個表單元素綁定。
?<label for="male">Male</label>
?<input type="radio" name="sex" id="male" />
?<br />
?<label for="female">Female</label>
?<input type="radio" name="sex" id="female" />
2018-01-31
類似于 title 吧? 起一個說明作用?? 沒什么大用? 不要糾結這個
2018-01-31
有大用