HTML option label attribute
Examples
Using the label attribute in <option> element:
<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>
<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>
try it"
Browser Support
In addition to Firefox, other major browsers support the label property.
Note: 7 and earlier versions of Internet Explorer does not support the label property <option> tag.
Definition and Usage
label attribute specifies a shorter version of the option.
Drop-down list will show a shorter version of the regulations.
Differences between HTML 4.01 and HTML5
no.
grammar
<option label="text">
Property Value
值 | 描述 |
---|---|
text | 选项的更短的版本。 |
HTML <option> tag