<legend> Description:
The <legend></legend> element assigns a caption to fieldsets within forms.
<legend> Web Browser Support:
- Netscape 6, 7
- Mozilla 1
- Firefox 1
- Internet Explorer 4, 5, 6
- Opera 6, 7, 8
- Safari 1
- HTML 4.0
- XHTML 1.0: XHTML Forms Module, XHTML Legacy Module
<legend> Attributes:
- accesskey (optional)
- align (optional) DEPRECATED
- class (optional)
- dir (optional)
- id (optional)
- lang (optional)
- onclick (optional)
- ondblclick (optional)
- onkeydown (optional)
- onkeypress (optional)
- onkeyup (optional)
- onmousedown (optional)
- onmousemove (optional)
- onmouseout (optional)
- onmouseover (optional)
- onmouseup (optional)
- style (optional)
- title (optional)
<legend> End Tag:
</legend> REQUIRED
<legend> Contents:
Text. The following tags are valid within the <legend> tag:
a, abbr, acronym, applet, b, basefont, bdo, big, br, button, cite, code, dfn, em, font, i, iframe, img, input, kbd, label, map, object, q, s, samp, script, select, small, span, strike, strong, sub, sup, textarea, tt, u, var
<legend> Valid Context:
The <legend> tag is valid within the following tags:
fieldset
<legend> Usage:
- Standard <legend>
<form> <fieldset> <legend align="right">Name</legend> <legend align="left">Required Field</legend> <label for="firstname"> First Name: <input name="firstname" id="firstname"> </label> <legend align="left">Non-required Field</legend> <label for="lastname"> Last Name: <input name="lastname" id="lastname"> </label> </fieldset> </form>
<legend> Special Notes:
- Use the legend field to make your forms accessible, especially when they are not rendered in a graphical manner.

