Home > Element Reference : Label

Contents

### Label

This element is used to provide a label for an control element, If the user clicks the label, it will move the focus to the associated control, specified with the control attribute.

More information about Label

#### Attributes:

Attributes inherited from XUL Element

accesskey

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the label. This letter will typically be drawn underlined, although this behavior will be platform and skin specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the label will be activated from anywhere in the window.

control

This attribute should be set to the id of an element that the label is associated with. When the user clicks on the label, the associated element is given the focus.

crop

If the label of the label is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be placed in place of the cropped text. If the box direction is right to left (rtl), the cropping is reversed.

- start: The text will be cropped on its left side.
- end: The text will be cropped on its right side.
- left: (Deprecated) The text will be cropped on its left side.
- right: (Deprecated) The text will be cropped on its right side.
- center: The text will be cropped on both sides.
- none: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.

disabled

If this attribute is set to true, the label is disabled. This is usually drawn with the text in grey. If the label is disabled, the function of the button cannot be performed. Leave the attribute out entirely for a regular enabled button.

value

The text to be used for the label.

#### Properties and Methods:

Properties and Methods inherited from XUL Element

accesskey

Gets and sets the value of the accesskey attribute.

control

Gets and sets the value of the control attribute.

crop

Gets and sets the value of the crop attribute.

disabled

Gets and sets the value of the disabled attribute.

value

Gets and sets the value of the value attribute.

Copyright (C) 1999 - 2002 XULPlanet.com