<select>...</select>

HTML4 HTML5

The <select> tag creates a drop-down list of options in a form[cite: 3]. The user can select one (or multiple, if allowed) option defined via <option> tags[cite: 3].

Both opening and closing tags are mandatory[cite: 3].

Attributes:

Example

In the example below, the <select> tag creates a drop-down menu to pick a city[cite: 3]:

Code:

<label for="city">Choose a city:</label> <select id="city" name="city"> <option value="warszawa">Warsaw</option> <option value="krakow" selected>Krakow</option> <option value="gdansk">Gdansk</option> </select>

The browser will interpret this code as follows: