HTML | DOM Option defaultSelected Property
The DOM Option defaultSelected Property is used to return the default value of a selected attribute. The selected attribute in HTML is used to specify which option should be by default selected when the page loads. This is a boolean attribute. The option that is having the selected attribute will be displayed by default.
- It is used to return the Property.
Return Value: It returns a Boolean value which represent that the option is selected by default or not.
Example: This Example illustrate how to return the selected property.
Before Clicking On Buttton:
After Clicking On Button:
Supported Browsers: The browser supported by DOM Option defaultSelected Property are listed below:
- Google Chrome
- Internet Explorer
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.