![]() |
Definition and Usage
The When present, it specifies that an option should be pre-selected when the page loads. The pre-selected option will be displayed first in the drop-down list.
Tip:
The Applies to
The
Browser Support
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The option selected attribute</h1>
<label for="cars">Choose a car:</label>
<select id="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="vw">VW</option> <option value="audi" selected>Audi</option>
</select>
</body>
</html>
html selected attribute |
How to add A drop-down list with a pre-selected option - HTML selected Attribute | HTML Attribute |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Attribute |
Uploaded by
: |
Admin |
Read Article https://horje.com/learn/1434/reference