Option selected Property
Option Object
Definition and Usage
The selected property sets or returns the value of the selected attribute of the option.
This property sets the current state of the option; if true, the option is selected. The initial value of this property comes from
Syntax
Set the selected property:
optionObject.selected=true|false
Return the selected property:
optionObject.selected
Browser support





All major browsers support the selected property
Example
Example
This example can change the selected option in the dropdown list:
Try it »
Option Object