<p>The <strong class=html>OPTION</strong> element defines a <em>menu choice</em> within a <strong class=html><a href="select.html">SELECT</a></strong> menu. The value of the option, sent with a submitted form, is specified with the <strong class=html>VALUE</strong> attribute. In the absence of a <strong class=html>VALUE</strong> attribute, the value is the content of the <strong class=html>OPTION</strong> element.</p>
<p>The boolean <strong class=html>SELECTED</strong> attribute defines the <strong class=html>OPTION</strong> to be initially selected. A <strong class=html>SELECT</strong> element can only have one <strong class=html>OPTION</strong> selected at any time unless the <strong class=html>MULTIPLE</strong> attribute is present on <strong class=html>SELECT</strong>.</p>
<div class=note>
<p>If the <strong class=html>SELECT</strong> element does not use the <strong class=html>MULTIPLE</strong> or <strong class=html>SIZE</strong> attributes, some browsers will automatically (and incorrectly) select an option. To ensure that a suitable option is selected, authors may wish to use the <strong class=html>SELECTED</strong> attribute on an <strong class=html>OPTION</strong>. If no option is a suitable default, consider using a dummy option, as in the following example:</p>
<p>The boolean <strong class=html>DISABLED</strong> attribute, new in HTMLá4.0 and poorly supported by current browsers, makes the <strong class=html>OPTION</strong> element unavailable. A disabled option cannot be selected by the user and is never submitted with the form.</p>
<p>The <strong class=html>LABEL</strong> attribute specifies the option label presented to the user. This defaults to the content of the <strong class=html>OPTION</strong> element, but the <strong class=html>LABEL</strong> attribute allows authors to more easily use <strong class=html><a href="optgroup.html">OPTGROUP</a></strong> without sacrificing compatibility with browsers that do not support option groups. The following example illustrates the technique:</p>
<pre class=example><code class=html><P>Which Web browser do you use most often?
<OPTION LABEL="3.x">Microsoft Internet Explorer 3.x</OPTION>
<OPTION LABEL="2.x">Microsoft Internet Explorer 2.x</OPTION>
<OPTION LABEL="1.x">Microsoft Internet Explorer 1.x</OPTION>
</OPTGROUP>
<OPTGROUP LABEL="Opera">
<OPTION LABEL="3.x or higher">Opera 3.x or higher</OPTION>
<OPTION LABEL="2.x">Opera 2.x</OPTION>
</OPTGROUP>
<OPTION>Other</OPTION>
</SELECT>
</P></code></pre>
<p><strong class=html>OPTGROUP</strong> and <strong class=html>OPTION</strong>'s <strong class=html>LABEL</strong> attribute were introduced together, so browsers should support both features or neither of them. Supporting browsers will render the preceding example using the <strong class=html>LABEL</strong> attribute of <strong class=html>OPTION</strong> to provide just the version number, along with the <strong class=html>OPTGROUP</strong>'s <strong class=html>LABEL</strong>, which gives the full name of the application. This allows a compact display with cascading menus, but many browsers do not yet support <strong class=html>OPTGROUP</strong>. These browsers will ignore the <strong class=html>OPTGROUP</strong> elements and <strong class=html>LABEL</strong> attributes, providing the full name and version for each choice. Thus authors can fully use <strong class=html>OPTGROUP</strong> despite its lack of browser support.</p>
<h2>More Information</h2>
<ul>
<li><a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-OPTION">OPTION in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá4.0 Recommendation</a></li>
<li><a href="http://www.w3.org/TR/REC-html32#select">OPTION in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá3.2 Recommendation</a></li>
<li><a href="http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.1.3.1">OPTION in HTMLá2.0 Standard</a></li>
<li><a href="http://www.htmlhelp.com/reference/wilbur/form/option.html">OPTION in <abbr class=initialism title="Web Design Group">WDG</abbr> HTMLá3.2 Reference</a></li>
<li><a href="http://www.hut.fi/u/jkorpela/HTML3.2/5.41.html">OPTION in <cite>Learning HTMLá3.2 by Examples</cite></a></li>
</ul>
<div class=footer>
<address>Maintained by <a href="http://www.htmlhelp.com/%7Eliam/">Liam Quinn</a> <<a href="mailto:liam@htmlhelp.com">liam@htmlhelp.com</a>></address>