1. Home
  2. Computing & Technology
  3. Web Design / HTML

<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:

Return to XHTML Element (HTML Tags) Library

About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >