contents.gifindex.gifprev1.gifnext1.gif

pueblo00000000.gif <option> element

The Option element can only occur within a <select> element, and represents one choice for the <select> element.

The contents of the Option element is presented to the user to represent the option. The contents are used as a returned value if the VALUE attribute is not present.

Attributes

SELECTED

Indicates that this option is initially selected.

VALUE

When present indicates the value to be returned if this option is chosen. The returned value defaults to the contents of the Option element.

Examples

The following example defines a form that contains a single <select> element and a submit button:

<form method=post action="http://www.chaco.com/htbin-post/post-query">

What would you like to do today?

<select name="what-to-do">

<option>Drink Coffee

<option selected>Use Pueblo

<option >Use VR Scout

<option >Read A Book

<option>Take A Walk

<option>Buy A Bagel

</select>

<input type=submit value=" Enter my agenda ">

</form>

Also see

<form>

<input>

<select>

<textarea>