Att Option Label π
2026-06-14 | π HTML
## HTML label Attribute
The `label` attribute of the ` ` tag is used to specify a shorter, more concise version of an option in a drop-down list. When present, browsers will display the value of the `label` attribute in the drop-down menu instead of the text content nested between the opening and closing ` ` tags.
---
## Definition and Usage
The `label` attribute defines an alternative, typically shorter, text label for an option.
* **Primary Purpose:** It allows developers to provide detailed, descriptive text inside the ` ` tags (which is useful for screen readers or fallback scenarios) while displaying a clean, compact label in the user interface.
* **Rendering Behavior:** If the `label` attribute is specified, the browser displays the attribute's value in the drop-down list instead of the inner HTML/text of the ` ` element.
---
## Syntax
```html
```
### Attribute Values
| Value | Description |
| :--- | :--- |
| *text* | Specifies the shorter, user-friendly text representation of the option. |
---
## Code Example
In the example below, the drop-down menu displays the short brand names specified in the `label` attributes ("Volvo", "Saab", etc.), while the longer descriptive text remains inside the tags.
```html
Choose a car:
Volvo (Latin for "I roll")
Saab (Swedish Aeroplane AB)
Mercedes (Mercedes-Benz)
Audi (Auto Union Deutschland Ingolstadt)
```
---
## Browser Support and Compatibility
| Chrome | Edge | Firefox | Opera | Safari |
| :---: | :---: | :---: | :---: | :---: |
| Yes | Yes | Yes | Yes | Yes |
### Compatibility Notes
* **Firefox Support:** Modern versions of Mozilla Firefox fully support the `label` attribute. Older versions occasionally had inconsistent rendering behaviors where they would default to the inner text instead of the label attribute.
* **Legacy Internet Explorer:** Internet Explorer 7 and earlier versions do not support the `label` attribute on the ` ` tag.
---
## HTML 4.01 vs. HTML5
There are no functional differences in how the `label` attribute is defined or used between HTML 4.01 and HTML5. It remains a standard attribute for the ` ` element across both specifications.