The label attribute on an <option> tag specifies a shorter version of the option‘s text content.
The label value will display instead of the longer text version.
A label attribute on <option> elements.
The shorter label values are displayed rather than the longer country names.
<select>
<option>-- Select Country --</option>
<option value="1" label="USA">United States of America</option>
<option value="2" label="UK">United Kingdom</option>
<option value="3" label="UAE">United Arab Emirates</option>
</select>
The label attribute specifies a shorter version of the option text.
The label value will display instead of the content text.
<option label="text">
Value | Description |
---|---|
text | Shorter version of the option text. |
Here is when label support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
2.0 | Oct 2006 |
IE/Edge
|
8.0 | Mar 2009 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <option>