HTML | PHP | Forum

HTML <option> tag


<option> - </option>

Definition and Usage

The OPTION element defines an option in the drop-down list. 

Optional Attributes

Attribute Value Description
disabled disabled Specifies that the option should be disabled when it first loads
label text Defines a label to use when using <optgroup>
selected selected Specifies that the option should appear selected 
value text Defines the value of the option to be sent to the server

Standard Attributes

id, class, title, style, dir, lang, xml:lang, tabindex

For a full description, go to Standard Attributes.

Event Attributes

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


Source Output
<optgroup label="Strategy Games">
<option value ="Civilization">Civilization</option>
<option value ="Conquest">Conquest</option>
<option value ="Age">Age of Mythology</option>
<optgroup label="Sport Games">
<option value ="FIFA2006">FIFA2006</option>
<option value ="NBA">NBA</option>


Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<h1> to <h6>


Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us