Form Element: Select & Option

The <select> element defines a drop-down list. The <option> elements defines the options from which to select.

HTML file: Displayed by browser:
<form action="http://www.w3schools.com/html/action_page.php">
  <select name="cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="fiat" selected>Fiat</option>
    <option value="audi">Audi</option>
  </select>
  <br /><br />
  <input type="submit">
</form>


Note: this document has both the <select> element as well as the selected attribute. With the attribute, you can specify which item displays in the text box. The default is to display the FIRST option, which in this case, would have been "Volvo".

Back button Table of Contents Next button