W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y

<OPTION>...[</OPTION>]

Description

This describes an option in a listbox of a form. It is only valid inside the SELECT element. It creates a selectable choice from which the user can pick a value.

DTD

<!ELEMENT OPTION - O (#PCDATA)         -- selectable choice -->
<!ATTLIST OPTION
  %attrs;                              -- %coreattrs, %i18n, %events --
  selected    (selected)     #IMPLIED
  disabled    (disabled)     #IMPLIED  -- unavailable in this context --
  label       %Text;         #IMPLIED  -- for use in hierarchical menus --
  value       CDATA          #IMPLIED  -- defaults to element content --
  >
from the HTML 4.0 DTD, "Copyright © W3C, (MIT, INRIA, Keio). All Rights Reserved."

Attributes

Core attributes: class id style title
Internationalization attributes: dir lang
Events: onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup

W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
DISABLED
This attribute makes this option in the selection list non-functional, so the user cannot select this option from the list.
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
LABEL
The label that will be used for the selection list.
W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
SELECTED
This attribute indicates that this option is the default selected choice in the listbox. If this attribute is not present in one of the options the first option is the default value.
W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y
VALUE
If this attribute is present it specifies the value that has to be send to the server instead of the value behind the option. If this attribute is not set, the initial value is set to the text you put in the OPTION element.

Examples

Source
<FORM>
What do you want on your pizza :
<SELECT>
<OPTION value="pepper">Extra peppers
<OPTION value="cheese" selected>Extra cheese
<OPTION value="pepper;cheese">Extra peppers & extra cheese
</SELECT>
</FORM>
 
Result
What do you want on your pizza :
Statistics