jump

HTML 5: The Markup Language (ARIA Edition)

labelcaption for a form control # T

The label element represents a caption for a form control.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
for = ID reference #
The value of the id attribute on a form control for which the label is a caption.
region = #
(detailed attribute description to come)
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.

Additional constraints and admonitions #

Tag omission #

A label element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLLabelElement : HTMLElement {
  readonly attribute HTMLFormElement? form;
           attribute DOMString htmlFor;
  readonly attribute HTMLElement? control;
};

Typical default display properties #

label {
cursor: default; }