jump

HTML: The Markup Language

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