# option

Specifies an option in a select (selection list) element.

## Platform Support

IE | Netscape | Mozilla | Opera | Safari
--- | --- | --- | --- | ---
2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+

## Example

This example shows a select list of dog breeds with three list items. The two large breeds are grouped together into an option group.

    <select name="dog" id="dog" >
    	<optgroup label= "bigDogs" >
    		<option id="lab" label="lab" value="lab" > Labrador retriever </option>
    		<option id="golden" label="golden" value="golden" > Golden retriever </option>
    	</optgroup>
    	<option id="pug" label="pug" value="pug" > Pug </option>
    </select>

## Remarks

<option></option> tags should always be nested within a <select></select> element.

## Attribute Detail

Attribute | IE | Netscape | Mozilla | Opera | Safari
--- | --- | --- | --- | --- | ---
class [class-name]. Example values: header-class, list-element, etc. CSS class assigned to the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
dir Direction of the element text. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
disabled Specifies whether or not the element is disabled. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
id [element-id] Unique identifier for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
label [element-label] Short text description for the element. | 4.0+ |  | 1.0+ | 4.0+ | 1.0+
lang [language-code]. Example values: "en" (English), "fr" (French), "es" (Spanish), etc. Language code for the content of the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
language Script language for the element. | 3.0+ | 2.0+ | 1.0+ | no | 1.0+
selected If present, specifies that the element selected by default. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
style [style-name] Inline style for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
title [text-description] Short text description for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
value [value-text] Text containing the value of the element. | 4.0+ | 1.1+ | 1.0+ | 7.0+ | 1.0+

## Event Detail

Event | IE | Netscape | Mozilla | Opera | Safari
--- | --- | --- | --- | --- | ---
onclick Fires when the element is clicked. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
ondblclick Fires when the element is double-clicked. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
ondeactivate Fires when the active element becomes inactive. | 4.0+ | no | no | no | no
onkeydown Fires when a user presses down on a key while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onkeypress Fires when a user presses a key or holds down the key while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onkeyup Fires when a user releases a key while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onlayoutcomplete Fires when Print or Print Preview finishes laying out the content in a LayoutRect with the source data. | 4.0+ | no | no | no | no
onlosecapture Fires when the element loses mouse capture. | 4.0+ | no | no | no | no
onmousedown Fires when a user clicks down on the mouse button while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onmouseenter Fires when the mouse pointer enters the element. | 4.0+ | no | no | no | no
onmouseleave Fires when the mouse pointer leaves the element. | 4.0+ | no | no | no | no
onmousemove Fires when the mouse moves while the pointer over the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onmouseout Fires when the mouse pointer moves off of the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onmouseover Fires when the mouse pointer moves over the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onmouseup Fires when the user releases the mouse button while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onmousewheel Fires when the user rotates the mouse wheel while the element has focus. | 4.0+ | no | no | no | no
onmove Fires when the element moves. | 4.0+ | no | no | no | no
onpropertychange Fires when one of the properties of the element changes. | 4.0+ | no | no | no | no
onreadystatechange Fires when the ready state of the element changes. | 4.0+ | no | no | no | no
onselectstart Fires immediately before the element is selected. | 4.0+ | no | no | no | 1.0+
ontimeerror Fires when a time-related error occurs. | 4.0+ | no | no | no | no

## Availability

W3C HTML 4.01

text_html aptana_docs