【HTML】Advanced5:Accessible Forms

1.label


<form>
<label for="yourName">Your Name</label>
<input name="yourName" id="yourName">
<!-- etc. -->
</form>

id for the  to associate it to.

2.fieldset & legend


<form action="somescript.php" >
<fieldset>
<legend>Name</legend>
<p>First name <input name="firstName"></p>
<p>Last name <input name="lastName"></p>
</fieldset>
<fieldset>
<legend>Address</legend>
<p>Address <textarea name="address"></textarea></p>
<p>Postal code <input name="postcode"></p>
</fieldset>
<!-- etc. -->

3.optgroup label


<select name="country">
<optgroup label="Africa">
<option value="gam">Gambia</option>
<option value="mad">Madagascar</option>
<option value="nam">Namibia</option>
</optgroup>
<optgroup label="Europe">
<option value="fra">France</option>
<option value="rus">Russia</option>
<option value="uk">UK</option>
</optgroup>
<optgroup label="North America">
<option value="can">Canada</option>
<option value="mex">Mexico</option>
<option value="usa">USA</option>
</optgroup>
</select>

4.<input name="firstName" accesskey="f" tabindex="1">

上一篇:HTML 部分非常用标签


下一篇:配置超级用户口令(Cisco IOS系统)