← 4.10.4 The fieldset elementTable of contents4.10.6 The label element →

4.10.5 The legend element

Contexts in which this element can be used:
As the first child of a fieldset element.
Content model:
Phrasing content.
Content attributes:
Global attributes
DOM interface:
interface HTMLLegendElement : HTMLElement {
  readonly attribute HTMLFormElement? form;

The legend element represents a caption for the rest of the contents of the legend element's parent fieldset element.

legend . form

Returns the element's form element, if any, or null otherwise.