Textareas
Here's the HTML markup:
<label for="address">Enter your address:</label><br />
<textarea id="address" name="addresstext"></textarea>
Select menus
Here's the HTML markup:
<label for="favcity">Choose your favorite city?</label>
<select id="favcity" name="select">
<option value="1">Amsterdam</option>
<option value="2">Buenos Aires</option>
<option value="3">Delhi</option>
<option value="4">Hong Kong</option>
<option value="5">London</option>
<option value="6">Los Angeles</option>
<option value="7">Moscow</option>
<option value="8">Mumbai</option>
<option value="9">New York</option>
<option value="10">Sao Paulo</option>
<option value="11">Tokyo</option>
</select>
To improve the accessibility of this list even further, we could add optgroup, to group the options. Note that the optgroup tag is not fully supported by some user agents and screen readers. In cases where optgroup is not supported, it is simply ignored and will not cause any accessibility issues.
Here's the HTML markup:
<label for="favcity2">Choose your favorite city?</label>
<select id="favcity2" name="favcity2">
<optgroup label="Asia">
<option value="3">Delhi</option>
<option value="4">Hong Kong</option>
<option value="8">Mumbai</option>
<option value="11">Tokyo</option>
</optgroup>
<optgroup label="Europe">
<option value="1">Amsterdam</option>
<option value="5">London</option>
<option value="7">Moscow</option>
</optgroup>
<optgroup label="North America">
<option value="6">Los Angeles</option>
<option value="9">New York</option>
</optgroup>
<optgroup label="South America">
<option value="2">Buenos Aires</option>
<option value="10">Sao Paulo</option>
</optgroup>
</select>
Do not confuse the label attribute of the optgroup element with the label element. They are very different things.
Multiple select menus allow the user to choose more than one option from the list.
Note
Most browsers allow you to select multiple, non-adjacent items with the keyboard by using the arrow keys or CTRL plus the arrow keys to navigate
and the space bar to select/deselect individual options. However, in Internet
Explorer, you can only activate this keyboard functionality by pressing Shift + F8 while in the multiple select menu. Because of the obscurity of this shortcut
and functionality, it is recommended that multiple select menus be avoided. Typically, a set of check box options can provide similar, yet more accessible functionality.
JavaScript jump menus
Because these types of menus are activated when the menu item changes, these menus can cause keyboard accessibility issues because you cannot scroll through the list without selecting one of the options.
Note
Some browsers (including Firefox) override these jump menus so they are not activated on keyboard change, but only after you either select an item using a mouse or press Enter if using the keyboard.
Providing a submit button separate from the list of choices that activates the currently selected item will allow full keyboard accessibility