English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML option label attribute

The label attribute specifies a shorter version of the option. The shorter version will be displayed in the dropdown list.

 HTML <option> tag

Online Example

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 ‹/›

Browser Compatibility

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.

Definition and Usage

The label attribute specifies the shorter version of the option.
The shorter version will be displayed in the dropdown list.

HTML 4.01 with HTML5differences

None.

Syntax

<option label="text">

attribute value

valuedescription
textA shorter version of the option.
 HTML <option> tag