When a screen reader accesses a form item that has a label associated with it, it will read the label and indicate the type of form item it is (e.g., "First Name. Text box" or "Age. Check box"). Labels are needed for all form elements, except for buttons.
Do not use JavaScript to automatically change the location of the Web browser (the onChange event).
| 1 |
2
|
3 |
|
| 4 |
5 |
6 |
7 |
| 8 |
9 |
10 |
11 |
| 12 |
13 |
14 |
|
<tr>
<td> <div style="/*/*/text-align: right;">
<label for="country">Country</label>
</div></td>
<td> <input id="country" type="text" name="textfield38" size="12" /> </td>
</tr>
<td style="background-color: rgb(204, 204, 255);"> <fieldset>
<legend>Internet Speed </legend>
<br />
<input id="l288" type="radio" name="radiobutton4" value="radiobutton" />
<label for="l288"> 28.8</label>
<br />
<input id="l56k" type="radio" name="radiobutton4" value="radiobutton" />
<label for="l56k">56k </label>
<br />
<input id="t1" type="radio" name="radiobutton4" value="radiobutton" />
<label for="t1">T1</label>
</fieldset></td>
Here's the markup, y'all:
<label for="name">Name</label>
<input id="name" type="text" name="textfield">
Here's the HTML markup:
<label for="motives">Explain your motives:</label><br>
<textarea id="motives" name="textfield2"></textarea>
<fieldset>
<legend>Choose a color:</legend><br>
<input id="blue" type="checkbox" name="checkbox" value="checkbox">
<label for="blue">Blue</label><br>
<input id="yellow" type="checkbox" name="checkbox2" value="checkbox">
<label for="yellow">Yellow</label>
</fieldset>
<fieldset>
<legend>Choose a car:</legend><br>
<input id="dart" type="radio" name="radio" value="dart">
<label for="dart">Dodge Dart</label><br>
<input id="pinto" type="radio" name="radio" value="pinto">
<label for="pinto">Ford Pinto</label>
</fieldset>
Here's the HTML:
<label for="favcity">Which is your favorite city?</label>
<select id="favcity" name="favcity">
<option value="1">Amsterdam</option>
<option value="3">Interlaken</option>
<option value="4">Moscow</option>
</select>
There are no special HTML tags for buttons. They are accessible as long as you use a standard button. Remember to use an ALT if the button is also an image!
Here's the markup:
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">