ⓘ label – caption for a form control # T
The
label
element
represents a caption for a form control.
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 #
-
The label element must not contain any nested
label elements.
-
The label element may contain at most one descendant
input element,
button element,
select element,
or textarea element.
-
The for attribute of the label element must refer to a form control.
-
The interactive element label must not
appear as a descendant of the a element.
-
The interactive element label must not
appear as a descendant of the button element.
Permitted parent elements #
any element that can contain
phrasing elements
Typical default display properties #