HTML <option> selected attribute
HTML <option> tag
Example
A drop-down list with a preselected option:
<select>
<option>Volvo</option>
<option selected="selected">Saab</option>
<option>Mercedes</option>
<option>Audi</option>
</select>
|
Try it yourself!
|
Definition and Usage
The selected attribute specifies that an option should be preselected when
the page loads.
The selected option will be displayed first in the drop-down list.
The selected attribute can also be set after the page load, with a
JavaScript.
Browser Support

The selected attribute is supported in all major browsers.
Syntax
<option selected="value">
|
Attribute Values
Value |
Description |
selected |
Selects an option |
HTML <option> tag
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|