<option>
- description
- defines the options available in a <select> drop-down list.
- Viewable in:
- Netscape 2, 3, 4, 6
- Internet Explorer 2, 3, 4, 5
- Opera 3
- WebTV
- HTML 4.0, 3.2
- attributes
- disabled (optional)
(Internet Explorer only) marks the object unusable by the reader
- selected (optional)
the default and pre-selected value for the select field. if omitted, the
first option will be selected
- value (optional)
the information sent to the server when a specific option is, selected. if
omitted, the text within the tag is, sent to the server.
- end tag
- </option> optional
- contents
- text. No tags are valid within the <option> tag.
- valid context
- The <option> tag is valid within the following tag:
select
- examples
- basic options list
<form>
<select name="list">
<option>Name your favorite pet
<option>dog
<option>cat
<option>rabbit
</select>
</form>
- alternate item selected
<form>
<select name="list">
<option>Name your favorite pet
<option>dog
<option selected>cat
<option>rabbit
</select>
</form>
- special notes
- using the value attribute is a good idea, especially when the option text
includes, spaces or other non-alphabetical characters
- while not required, the end tag </option> is useful when using
DHTML with a select list
Return to HTML Tag Library