<p>In my specific example, I'm dealing with a drop-down, e.g.:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select name="foo" id="bar"&gt;
  &lt;option disabled="disabled" selected="selected"&gt;Select an item:&lt;/option&gt;
  &lt;option&gt;an item&lt;/option&gt;
  &lt;option&gt;another item&lt;/option&gt;
&lt;/select&gt;</code></pre>
</div>
</div>
</p>

<p>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.</p>

<p><strong>Update:</strong> 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 <code>onchange()</code>. This is <em>fairly</em> 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 <code>onchange</code> drop downs altogether, or should the "select..." option be selectable, just with no effect?</p>

[{'answer_id': 49802, 'author': 'David Heggie', 'author_id': 4309, 'author_profile': 'https://Stackoverflow.com/users/4309', 'pm_score': 3, 'selected': False, 'text': "<p>The HTML specs are a bit vague (ie. completely lacking) with regard to this odd combination. They do say that a form element with the disabled attribute set should not be successful, so it really <em>can't</em> be selected.</p>\n\n<p>The browser may well render it so that it looks selected, but it shouldn't show up in the POSTed data. Looks like Opera's got it right to me.</p>\n"}, {'answer_id': 49814, 'author': 'Glenn Slaven', 'author_id': 2975, 'author_profile': 'https://Stackoverflow.com/users/2975', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://www.w3.org/TR/html401/interact/forms.html#edef-OPTION" rel="nofollow noreferrer">The HTML specs</a> state that both selected &amp; disabled are available options for the <code>&lt;option&gt;</code> element, but doesn\'t specify what should happen in case of a conflict.  In the <a href="http://www.w3.org/TR/html401/interact/forms.html#disabled" rel="nofollow noreferrer">section on disabled controls</a> it says</p>\n\n<blockquote>\n  <p>When set, the disabled attribute has\n  the following effects on an element:</p>\n  \n  <ul>\n  <li>Disabled controls do not receive focus. </li>\n  <li>Disabled controls are skipped in tabbing navigation. </li>\n  <li>Disabled controls cannot be successful.</li>\n  </ul>\n</blockquote>\n\n<p>it also says</p>\n\n<blockquote>\n  <p>How disabled elements are rendered depends on the user agent. For example, some user agents "gray out" disabled menu items, button labels, etc. In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form.</p>\n</blockquote>\n\n<p>While this specific case isn\'t specified, my reading of this says that the actual rendering of a \'selected\' \'disabled\' element is left up to the browser.  As long as the user cannot select it then it\'s working as standard.  It does say that a script can act upon the element, so it is possible for Javascript to set a disabled option as selected (or disable a selected option).  This isn\'t contrary to the standards, but on form submission, that option\'s value couldn\'t be the selected value.  The select list would (I assume) have to have an empty value in this case.</p>\n'}, {'answer_id': 49815, 'author': 'Jason Bunting', 'author_id': 1790, 'author_profile': 'https://Stackoverflow.com/users/1790', 'pm_score': 1, 'selected': False, 'text': '<p>According to the HTML 4.01 Specification, <a href="http://www.w3.org/TR/html401/interact/forms.html#disabled" rel="nofollow noreferrer"><strong>disabled <em>is</em> a standard attribute for the option element</strong></a>, but behavior is probably indeterminate based on the standard (read over the information on the select element and the options elements. Here is a portion I think may shed light on Opera\'s reasons for their implementation:</p>\n\n<blockquote>\n  <p>When set, the disabled attribute has the following effects on an element:<br>\n    * Disabled controls do not receive focus.<br>\n    * Disabled controls are skipped in tabbing navigation.<br>\n    * Disabled controls cannot be successful.  </p>\n</blockquote>\n\n<p>So, it is very likely that this is just one of those things where the spec is vague enough to allow for both interpretations. This is the kind of idiosyncrasy that makes programming for the web so fun and rewarding. :P</p>\n'}, {'answer_id': 49862, 'author': 'Glenn Slaven', 'author_id': 2975, 'author_profile': 'https://Stackoverflow.com/users/2975', 'pm_score': 3, 'selected': True, 'text': "<p>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).</p>\n\n<p>From a usablilty point of view I'd suggest doing both, that way all bases are covered.</p>\n"}, {'answer_id': 49909, 'author': 'Daniel Miller', 'author_id': 5221, 'author_profile': 'https://Stackoverflow.com/users/5221', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>Are we just ruling out \'onchange\' drop\n  downs altogether, or should the\n  "select..." option be selectable, just\n  with no effect?</p>\n</blockquote>\n\n<p>"onchange" drop-downs are frowned upon by more standards-obsessed types.</p>\n\n<p>I would typically do some client-side validation. "Please select an item from the drop down" kind of thing. i.e.</p>\n\n<blockquote>\n  <p>should the "select..." option be selectable, just with no effect?</p>\n</blockquote>\n\n<p>So I just said "Yes" to your A or B question. :/ Sorry!</p>\n'}, {'answer_id': 168215, 'author': 'scunliffe', 'author_id': 6144, 'author_profile': 'https://Stackoverflow.com/users/6144', 'pm_score': 0, 'selected': False, 'text': '<p>unfortunately it doesn\'t really matter what should happen, because IE doesn\'t support the disabled attribute on options period.</p>\n\n<p><a href="http://webbugtrack.blogspot.com/2007/11/bug-293-cant-disable-options-in-ie.html" rel="nofollow noreferrer">http://webbugtrack.blogspot.com/2007/11/bug-293-cant-disable-options-in-ie.html</a></p>\n'}]
['https://Stackoverflow.com/questions/49790', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5058/']