[thelist] Accessibility/usability of "Select Option" at top of list

Marc. S. webdevpost at delime.com
Tue Jan 16 14:29:39 CST 2007


On 1/15/07, Matt Warden <mwarden at gmail.com> wrote:

>
> <select name="foo" id="foo">
> <option value="">Select Fruit</option>
> <option value="apple">Apple</option>
> <option value="orange">Orange</option>
> </select>

It's too bad browsers won't display the label of an OPTGROUP tag as
the first item in a select.

Otherwise one could potentially do

<select name="foo" id="foo">
<optgroup label="Select Fruit">
<option value="apple">Apple</option>
<option value="orange">Orange</option>
</optgroup>
</select>

Failing that though, if one is insistent on having *something* in the
option value then

<select name="foo" id="foo">
<option value="none selected">Select Fruit</option>
<option value="apple">Apple</option>
<option value="orange">Orange</option>
</select>

Not that I do this myself, I leave it blank, as in Matt's example.

regards.
-marc



More information about the thelist mailing list