lable for屬性
<form method="post" action="http://example.com/form">
<p>
<label for="fave">Fruit: <input id="fave" name="fave" /></label>
</p>
<p>
<label for="name">Name: <input id="name" name="name" /></label>
</p>
<button>Submit Vote</button>
</form>
當(dāng)點(diǎn)擊<label for="fave">時(shí),光標(biāo)焦點(diǎn)會(huì)定位到<input id="fave" 為的輸入框上,這樣方便用戶操作

a.gif