HTML: The Markup Language

labelcaption for a form control # T

The label element represents a caption for a form control.

Permitted content #

Permitted attributes #

Descriptions for attributes specific to this element #

for = IDREF
Identifies a form control for which the label is a caption.

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; }