Menu
Forms & Inputs

<select>, <option>, <optgroup>

Drop-down and multi-select menus.

1Selecting from a List

<select> creates a drop-down. Group related options with <optgroup>. Add the multiple attribute to allow multi-select.

Example Code
<label for="country">Country</label>
<select id="country" name="country">
  <optgroup label="Europe">
    <option value="fr">France</option>
    <option value="de">Germany</option>
  </optgroup>
  <optgroup label="Asia">
    <option value="in">India</option>
    <option value="jp">Japan</option>
  </optgroup>
</select>

Finished reading?

Mark this topic as complete to track progress.