[whatwg] Option label, textContent and value
Jonas Sicking
jonas at sicking.cc
Tue Jun 14 01:10:17 PDT 2011
On Tue, Jun 14, 2011 at 12:11 AM, Ian Hickson <ian at hixie.ch> wrote:
>> Furthermore, as I understand the above definitions, the spec does allow
>> to specify label and value in one step in a select element:
>>
>> <select>
>> <option>This is value and label
>> </select>
>>
>> But not in a datalist, as the label is taken from the textContent rather
>> than from the value of the option element:
>>
>> <datalist>
>> <option value="No label here">
>> <option label="No value here">
>> </datalist>
>
> The difference is that the value is typically shown in the datalist case.
At least <input type=email> seems like a very common example where
you'd want to show a label. Here you likely will want to show peoples
names, but choosing a name would use the email address as the .value
for the <input>.
/ Jonas
More information about the whatwg
mailing list