第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

用label有什么優(yōu)勢(shì)嗎,直接這樣不就行了

<!DOCTYPE html>

<html>

<head>

? ? <meta charset="UTF-8">

? ? <title>表單標(biāo)簽</title>

</head>

<body>

? ? <form method="post" action="save.php">

? ? ? ? 用戶名:<input type="text" name="username" placeholder="請(qǐng)輸入賬號(hào)" />

? ? ? ? 密碼:<input type="password" name="pass" placeholder="請(qǐng)輸入密碼" />

? ? ? ? <input type="submit" value="確定" name="submit" />

? ? ? ? <input type="reset" value="重置" name="reset" />

? ? </form>

</body>

</html>


正在回答

4 回答

label作用:


????1. <label>標(biāo)簽的 for 和<input>標(biāo)簽的 id 關(guān)聯(lián),點(diǎn)擊 label 的時(shí)候可以選中 input。

????2. 語義化,通常用來做 <input> 標(biāo)簽的內(nèi)容標(biāo)記。


示例:

<form>
????<label?for="man">男人</label>????????????//?用了label,點(diǎn)擊?男人?同時(shí)會(huì)選中復(fù)選框
????<input?type="checkbox"?id="man"?/>???????//?(type="checkbox"?是表示input類型是復(fù)選框)
????
????女人<input?type="checkbox"?id="woman">???//?不用label,點(diǎn)擊?女人?不會(huì)選中復(fù)選框
</form>


5 回復(fù) 有任何疑惑可以回復(fù)我~

你的提問很好,我也想得到最好的答案?

1 回復(fù) 有任何疑惑可以回復(fù)我~

<form method="post" action="save.php">

? ? ? ? <label for:name>用戶名:</label>

????????<input type="text" name="username" placeholder="請(qǐng)輸入賬號(hào)"? id="name"/>

用了label? 同時(shí)給input一個(gè)ID屬性 可以讓你在界面點(diǎn)擊用戶名的時(shí)候 跳轉(zhuǎn)到用戶名輸入框里 方便用戶操作吧? ?


0 回復(fù) 有任何疑惑可以回復(fù)我~

label的文字點(diǎn)擊就會(huì)直接打開輸入框,不用點(diǎn)擊輸入框這樣子的

2 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

用label有什么優(yōu)勢(shì)嗎,直接這樣不就行了

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)