The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's HTML Tag Reference

| Index | Previous Tag: <OPTGROUP> | Next Tag: <P> |


<OPTION>

Specifies an item in a form's <SELECT> list.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later
Notes:
  • Enter the item text after the <OPTION> tag.
Attributes:
CLASS = "Text"
The style sheet class used by the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • You can specify two or more classes; be sure to separate each class name with a space.

DISABLED
Prevents the user from being able to select he option.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

ID = "Text"
An alphanumeric string that uniquely identifies the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • Although you can use letters and numbers for the ID, the first character must be a letter.

LABEL = "Text"
In an <OPTGROUP> grouping, this is the text to display instead of the regular option text.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later Not supported Not supported

LANG = "Text"
The language used by the tag's attribute values and text content.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

SELECTED
Indicates that the option should be selected when the form first loads.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

STYLE = "Text"
The style or styles to use with the tag.

Support:

HTML StandardInternet ExplorerNetscape Navigator
4.0 and later 4.0 and later Not supported

Notes:

  • If you enter multiple style properties, separate each one with a semi-colon (;).

VALUE = "Text"
The initial value assigned to the option.

Support:

HTML StandardInternet ExplorerNetscape Navigator
2.0 and later 1.0 and later 1.0 and later

Example:
<FORM ACTION="http://www.mcfedries.com/cgi-win/formtest.exe" METHOD=POST>
<SELECT SIZE=5 NAME="HairColor">
<OPTION>Black</OPTION>
<OPTION SELECTED>Blonde</OPTION>
<OPTION>Brunette</OPTION>
<OPTION>Red</OPTION>
<OPTION>Something neon</OPTION>
</SELECT>
<INPUT TYPE=SUBMIT>
</FORM>
How It Looks:

| Index | Previous Tag: <OPTGROUP> | Next Tag: <P> |