In my specific example, I’m dealing with a drop-down, e.g.:
<select name='foo' id='bar'> <option disabled='disabled' selected='selected'>Select an item:</option> <option>an item</option> <option>another item</option> </select>
Of course, that’s pretty nonsensical, but I’m wondering whether any strict behaviour is defined. Opera effectively rejects the ‘selected’ attribute and selects the next item in the list. All other browsers appear to allow it, and it remains selected.
Update: To clarify, I’m specifically interested in the initial selection. I’m dealing with one of those ‘Select an item:’-type drop-downs, in which case the first option is really a label, and an action occurs onchange(). This is fairly well ‘progressively enhanced’, in that a submit button is present, and only removed via JavaScript. If the ‘select…’ option were removed, whatever then were to become the first item would not be selectable. Are we just ruling out onchange drop downs altogether, or should the ‘select…’ option be selectable, just with no effect?
In reply to the update in the question, I would say that the ‘label’ option should be selectable but either make it do nothing on submission or via JavaScript, don’t allow the form to be submitted without a value being selected (assuming it’s a required field).
From a usablilty point of view I’d suggest doing both, that way all bases are covered.