Change Language


Follow Navioo On Twitter

option

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

Browser/User Agent 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+
 
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+
 
Script language for the element.
3.0+ 2.0+ 1.0+ no 1.0+
 
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
Fires when the element is clicked.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when the element is double-clicked.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when the active element becomes inactive.
4.0+ no no no no
 
Fires when a user presses down on a key while the element has focus.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
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+
 
Fires when a user releases a key while the element has focus.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when Print or Print Preview finishes laying out the content in a LayoutRect with the source data.
4.0+ no no no no
 
Fires when the element loses mouse capture.
4.0+ no no no no
 
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+
 
Fires when the mouse pointer enters the element.
4.0+ no no no no
 
Fires when the mouse pointer leaves the element.
4.0+ no no no no
 
Fires when the mouse moves while the pointer over the element.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when the mouse pointer moves off of the element.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when the mouse pointer moves over the element.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when the user releases the mouse button while the element has focus.
2.0+ 1.0+ 1.0+ 4.0+ 1.0+
 
Fires when the user rotates the mouse wheel while the element has focus.
4.0+ no no no no
 
Fires when the element moves.
4.0+ no no no no
 
Fires when one of the properties of the element changes.
4.0+ no no no no
 
Fires when the ready state of the element changes.
4.0+ no no no no
 
Fires immediately before the element is selected.
4.0+ no no no 1.0+
 
Fires when a time-related error occurs.
4.0+ no no no no
 

Examples -> Source code Demo online - > option:

Ajax Javascript feed

↑ Grab this Headline Animator