1. Computing

Discuss in my forum

<option></option>

By , About.com Guide

<option> Description:

The <option> element defines elements in a select or drop-down list.

<option> Web Browser Support:

<option> Attributes:

<option> End Tag:

</option> REQUIRED

<option> Contents:

Text. The following tags are valid within the <option> tag:
None

<option> Valid Context:

The <option></option> tag is valid within the following tags:
select, optgroup

<option> Usage:

  • basic options list
    <form>
     <select name="list">
     <option>Name your favorite pet
     <option>dog</option>
     <option>cat</option>
     <option>rabbit</option>
     <option>horse</option>
     </select>
     </form>
  • alternate item selected
    <form>
     <select name="list">
     <option>Name your favorite pet
     <option>dog</option>
     <option>cat</option>
     <option>rabbit</option>
     <option selected="selected">horse</option>
     </select>
     </form>

<option> Special Notes:

  • Using the value attribute is a good idea, especially when the option text includes, spaces or other non-alphabetical characters.
  • The end tag <option> is required in XHTML documents.

More <option></option> Information:

  1. About.com
  2. Computing
  3. Web Design / HTML