Name

<LEGEND> — NN n/a IE 4 HTML 4

Synopsis

<LEGEND>...</LEGEND>

End Tag: Required

The LEGEND element acts as a label for a FIELDSET element. In visual browsers, this usually means that the label is visually associated with the group border rendered for the FIELDSET element. Internet Explorer 4 builds the LEGEND element into the FIELDSET border. A text-to-speech browser might read the label aloud as a user navigates through a form. In Internet Explorer, the LEGEND element must come immediately after the start tag of the FIELDSET element for the association to stick. Because the content of the LEGEND element is HTML content, you can assign styles to make the label stand out, if you like.

Example

<FORM METHOD=POST ACTION="...">
<FIELDSET>
<LEGEND>Credit Card Information</LEGEND>
...inputElementsHere...
</FIELDSET>
</FORM>

Object Model Reference

IE

[window.]document.all.elementID

Attributes

ACCESSKEY

CLASS

ID

LANGUAGE

TITLE

ALIGN

DIR

LANG

STYLE

 

Event Handler Attributes

Handler

NN

IE

HTML

onClick

n/a

4

4

onDblClick

n/a

4

4

onDragStart

n/a

4

n/a

onHelp

n/a

4

n/a

onKeyDown

n/a

4

4

onKeyPress

n/a

4

4

onKeyUp

n/a

4

4

onMouseDown

n/a

4

4

onMouseMove

n/a

4

4

onMouseOut

n/a

4

4

onMouseOver

n/a

4

4

onMouseUp

n/a

4

4

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.