cancel
Showing results for 
Search instead for 
Did you mean: 

Label attribute in <option> elements of select does not display, just the value, value. How do you show the label value?

Highlighted
New Contributor

Label attribute in <option> elements of select does not display, just the value, value. How do you show the label value?

I have a select with several long option values. I am using the label attribute to display a shorter version. Below is a simple example:

<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> 

It should display "Volvo" for the first select and so on, but instead it is displaying "Volvo (Latin for I roll).

The standards state that the label attribute is valid and it works in all other browsers (IE, Chrome, Safari), so how do I get the label attribute to work in Firefox?

Tags (2)