tags:

views:

49

answers:

2

Besides the fact that only IE7+ supports it, why would you use something such as this example? Namely:

<select>
  <option label="Volvo">Volvo (Latin for "I roll")</option>
  <option label="Saab">Saab (Swedish Aeroplane AB)</option>
</select>

After all, 'Latin for "I roll"' and 'Swedish Aeroplane AB' are lost (i.e., only remain in the source code).

Thanks!

+4  A: 

In that example, the long text will be sent to the server when the form is submitted.

Given the existence of the value attribute, it is redundant.

David Dorward
Thank you. So I gather that, if the "value" attribute were present, the long text would be irrelevant, right? Pretty disconcerting...
A: 

As per the definition of the option tag by the w3c :

"This attribute allows authors to specify a shorter label for an option than the content of the OPTION element. When specified, user agents should use the value of this attribute rather than the content of the OPTION element as the option label."

David's answer is pretty good, I just wanted to add a link to the official definition. :D

Eric-Karl