<option selected>

Attribute of
<option> HTML Tag
What does <option selected> do?
Defines the default selection in a drop-down list.

Code Example

<p><strong>Select your favorite species of flamingo.</strong></p>

<select name="favorites">
          <option value="American">American flamingo</option>
          <option value="Greater">Greater flamingo</option>
          <option value="Lesser">Lesser flamingo</option>
          <option selected value="Andean">Andean flamingo</option>
          <option value="Chilean">Chilean flamingo</option>
          <option value="James's">James's flamingo</option>
</select>

Select your favorite species of flamingo.

Convenient Form Entry

The selected attribute allows you to set one of your <option> lines as the default. This is a good technique to speed up data entry if the majority of visitors are likely to select the same option.

Claire is seasoned technical writer, editor and HTML enthusiast.

Browser Support for selected

AllAllAllAllAllAll