HTML Option selected attribute


A drop-down list with a preselected option:
  <option selected="selected">Saab</option>

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.


<option selected="value">

Attribute Values

Value Description
selected Selects an option
HTML Option selected attribute Reviewed by 1000sourcecodes on 21:42 Rating: 5
Powered by Blogger.