Language References
Assigns a caption to a FIELDSET object. | HTML 2, 3.2, 4, 4.01, 5 |
HTML Syntax
<legend
align = bottom | center | left | right | top
class = classname
id = value
style = css properties
title = text
event = script
>
The LEGEND element allows authors to assign a caption to a FIELDSET. The legend improves accessibility when the FIELDSET is rendered non-visually.
This element must be the first element in FIELDSET.
LEGEND Members
This sample demonstrates the use of LEGEND along with the FIELDSET and LABEL elements to develop an accessible form. The FIELDSET defines the container for the form.
<form>
<fieldset>
<legend>Accessibility Form</legend>
<table cellpadding=5>
<tbody>
<tr>
<th>Label</th>
<th>Control Range</th></tr>
<tr>
<td><label for=ofirstname tabindex=-1>
<u>F</u>irst Name</label></td>
<td><input accessKey=f id=ofirstname
name=firstname tabindex=1></td></tr>
<tr>
<td><label for=olastname tabindex=-1>
<u>L</u>ast Name</label></td>
<td><input accessKey=l id=olastname
name=lastname tabindex=2></td></tr>
<tr>
<td><label for=oselect1 tabindex=-1>
Favorite <u>P</u>astime</label></td>
<td><select accessKey=p id=oselect1
name=select1 tabindex=3>
<option selected>Web
<option>Movies
<option>Concerts
<option>Pubs
<option>Books</option>
</select></td></tr>
</tbody></table>
</fieldset>
</form>
Show me
FIELDSET