Label

Support Key: [2|3|3.2|4] [X1|X1.1] [IE4B2|M|N6B1|O4]
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson =
Main Index | Element Tree | Element Index | HTML Support History



   Quick Statistics   
End Tag:
   Required
Standards Details:
HTML: In all 4.x DTDs
XHTML: In all 1.0 and 1.1 DTDs
XHTML Modules:
Basic Forms, Forms
CSS 'display' Type:
"inline"
CSS Mapping:
NA
Default Rendering:
NA
Official Docs:
HTML 4.x, XHTML 1.1

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] [X1|X1.1] [IE4B2|M|N6B1|O4]
%Accessibility%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6|O5]
%Events%
[2|3|3.2|4] [X1|X1.1] [IE4B2|M|N6B1|O4]
%Language%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N6B2|O]
%Data%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N|O]
%Editing%
[2|3|3.2|4] [X1|X1.1] [IE5.5|M|N|O]

Specific Attributes
Accesskey
[2|3|3.2|4] [X1|X1.1] [IE4B2|M|N6|O7]
Standards Details: In all HTML 4.x/XHTML DTDs
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: CDATA. [A single, case-insensitive character from a browser's character set.]
For
[2|3|3.2|4] [X1|X1.1] [IE4B2|M|N6B1|O7]
Standards Details: In all HTML 4.x/XHTML DTDs
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: IDREF. [The value of an existing 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...