HTML <option> label-eigenschap

Definitie en gebruik

label De eigenschap bepaalt de kortere versie van de optie.

Deze kortere versie wordt weergegeven in de keuzelijst.

Voorbeeld

Gebruik de label-eigenschap binnen het <option>-element:

<label for="cars">Please select a car brand:</label>
<select id="cars">
  <option label="奥迪">Audi (Auto Union Deutschland Ingolstadt)</option>
  <option label="比亚迪">BYD (Build Your Dreams)</option>
  <option label="奔驰">Mercedes (Mercedes-Benz)</option>
  <option label="沃尔沃">Volvo (Latin for "I roll")</option>
</select>

Try it yourself

syntax

<option label="text">

attribute value

value description
text The shorter version of the option.

Browser support

The numbers in the table indicate the first browser version to fully support this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 8.0 Not supported Supported Supported