Label

End Tag: Required
Support Key: 2 | 3 | 3.2 | 4 | IE4B2 | M | N | O
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson [bloo@blooberry.com] =
Main Index | Element Tree | Element Index | HTML Support History


What is it?
The non-nestable LABEL element accomplishes two tasks: association of a description with a form field control and increasing the size of the active user interface region for selecting the form control. Description attachment is of greatest use to speech-based browsers, while the benefits of an increased user interface region are felt most by users of browsers that accommodate a pointing device (such as a mouse or pen.) Activating a LABEL with a pointing device passes input focus on to its associated form field control.

Labels are attached either explicitly or implicitly. Explicit attachment is accomplished through the use of a form field ID as the value of the FOR attribute. This method allows attachment of a LABEL to a field elsewhere in the document and has the advantage of allowing multiple LABELs to be attached to a single form field.

Form fields are attached implicitly to a LABEL when they are in the contents of the LABEL element. In this case, the LABEL must only contain one form field within the LABEL contents.

Common Attributes
%Core%
2 | 3 | 3.2 | 4 | IE4B2 | M | N | O
%Events%
2 | 3 | 3.2 | 4 | IE4B2 | M | N | O
%Language%
2 | 3 | 3.2 | 4 | IE4 | M | N | O
%Data%
2 | 3 | 3.2 | 4 | IE4 | M | N | O

Specific Attributes
Accesskey
2 | 3 | 3.2 | 4 | IE4B2 | M | N | O
Required? No
Description:
This is a method of giving access/focus to an active HTML element using a keyboard character. This is a common GUI paradigm also known as a "keyboard shortcut" or "keyboard accelerator" A single character is used as the value of this attribute. In addition, a platform-dependent key is usually used in combination with the ACCESSKEY character to access the functionality of the active field.
Values:
A single, case-insensitive alphanumeric character from a browser's character set.
For
2 | 3 | 3.2 | 4 | IE4B2 | M | N | O
Required? No
Description:
This attribute identifies which form field the LABEL is attached to. If this attribute is not used, the LABEL is associated with its contents.
Values:
The value of an ID attribute belonging to a form field in the
current document.
Example
<fieldset>
<legend ACCESSKEY=G TABINDEX=1>Gender</legend>
    <label ACCESSKEY=M><input TYPE=RADIO NAME=Gender VALUE=Male>Male</label> <br>
    <label ACCESSKEY=F><input TYPE=RADIO NAME=Gender VALUE=Female>Female</label>
</fieldset>
Parent Model
%In-line Parent% | %Block Parent%
Exceptions: <label>
Content Model
%In-line Content%
Exceptions: <label>
Tips & Tricks Browser Peculiarities
Boring Copyright Stuff...