martin2k

The OPTION Tag

HomeForumTutorials Tags:
 
 

Name

Option

Description

This tag defines each list item in the ComboBox control (drop-down list) on a web page.  You can enclose the OPTION tags in the OPTGROUP tag to separate items into groups.  The OPTION tag is used within the SELECT tag.

Attributes

DISABLED

Disables the list item.

SELECTED

Specifies that the list item will be selected when the page loads.  Only one OPTION tag in each ComboBox should use this attribute unless the SELECT tag's 'multiple' attribute is set.

VALUE

Specifies the internal value for the list item, which will be sent to the script.

Related Tags

This tag is used within the SELECT tag.  OPTION tags can be used within the OPTGROUP tag to separate list items into groups.

Example

Code

<select>
<option value="egypt">Egypt</option>
<option value="ethiopia">Ethiopia</option>
<option value="france">France</option>
<option value="germany">Germany</option>
<option value="sudan">Sudan</option>
<option value="uk" selected>UK</option>
</select>

Generates


Please fill in the below form if you have any comments or additional information you want to add about the above information.  If you have any questions, please visit the ForumAny questions sent using this form will be ignored.

* - Mandatory

*Name: E-mail:

*Comments:

*Please type the following code (your comment cannot be accepted without it):


© Martin Allen 1999 - 2006.  Last updated Sunday 22 October 2006 07:53:48 PM +0100.