<OPTION>
The OPTION element defines the individual choices a user has to pick
from in a SELECT input control. Each option represents a unique choice
and the user may select only one unless the MULTIPLE attribute is defined
on the SELECT element.
For long lists of options, the OPTGROUP element may be used to group
similar choices together.
Attributes
Attribute |
Description |
ID |
Identifies this tag to reference in script (program code) |
CLASS |
Define the class used to render this element (defined by a style sheet) |
SELECTED |
Indicates that this choice should be selected by default (when the form is
first loaded) |
VALUE |
Defines a value which the choice represents. This value will be assigned to
the form value when the user submits the form. If the value attribute is omitted,
the value will match the label (which follows this element) |
LABEL |
Alternative shorter version of the label that should be used by user agents
as the label for the option. |
|
Example
<FORM ACTION="formtest.php" METHOD="post">
<P>
<SELECT MULTIPLE SIZE="4" name="components">
<OPTION SELECTED VALUE="Component_1_a">Component_1</OPTION>
<OPTION SELECTED VALUE="Component_1_b">Component_2</OPTION>
<OPTION>Component_3</OPTION>
<OPTION>Component_4</OPTION>
<OPTION>Component_5</OPTION>
<OPTION>Component_6</OPTION>
<OPTION>Component_7</OPTION>
</SELECT>
<INPUT TYPE="submit" VALUE="Send"><INPUT type="reset">
</P>
</FORM>
Renders As:
Compatibility
HTML 4.01
|