Option defaultSelected Property
Option Object
Definition and Usage
The defaultSelected property returns the initial value of the selected attribute.
Returns true if the default option is selected, otherwise returns false.
If the form is reset, the selected attribute is reset to the value of this property. This property also sets the value of the selected attribute.
Note: The default option will be displayed first.
Syntax
optionObject.defaultSelected
Browser support





All major browsers support the defaultSelected property
Example
Example
The following example can detect whether the selected option is the default option:
Try it »
Option Object