## FIELDSET and LEGEND

align = top|bottom|left|right [CI]
  Deprecated. This attribute specifies the position of the legend with respect to the fieldset. Possible values:

-   top: The legend is at the top of the fieldset. This is the default value.
-   bottom: The legend is at the bottom of the fieldset.
-   left: The legend is at the left side of the fieldset.
-   right: The legend is at the right side of the fieldset.

Attributes defined elsewhere

- id, class (document-wide identifiers)

- lang (language information), dir (text direction)

- title (element title)

- style (inline style information)

- accesskey (access keys)

- onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)

The FIELDSET element allows authors to group thematically related controls and labels. Grouping controls makes it easier for users to understand their purpose while simultaneously facilitating tabbing navigation for visual user agents and speech navigation for speech-oriented user agents. The proper use of this element makes documents more accessible.

The LEGEND element allows authors to assign a caption to a FIELDSET. The legend improves accessibility when the FIELDSET is rendered non-visually.

In this example, we create a form that one might fill out at the doctor's office. It is divided into three sections: personal information, medical history, and current medication. Each section contains controls for inputting the appropriate information.

FIELDSET Example

Note that in this example, we might improve the visual presentation of the form by aligning elements within each FIELDSET (with style sheets), adding color and font information (with style sheets), adding scripting (say, to only open the "current medication" text area if the user indicates he or she is currently on medication), etc.