English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The label attribute specifies a shorter version of the option. The shorter version will be displayed in the dropdown list.
Using the label attribute within the <option> element:
<!DOCTYPE html> <html> <head> <title>HTML: <option> label attribute</title> - 基础教程网(oldtoolbag.com)</title> </head> <body> <select> <option label="Volvo">Volvo (Latin for "I roll")</option> <option label="Saab">Saab (Swedish Aeroplane AB)</option> <option label="Mercedes">Mercedes (Mercedes-Benz)</option> <option label="Audi">Audi (Auto Union Deutschland Ingolstadt)</option> </select> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
Except for Firefox, all major browsers support the label attribute.
Note:Internet Explorer 7 And earlier versions do not support the label attribute of the <option> tag.
The label attribute specifies the shorter version of the option.
The shorter version will be displayed in the dropdown list.
None.
<option label="text">
value | description |
---|---|
text | A shorter version of the option. |