![]() |
Definition and UsageThe 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 toThe
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 |
Read Full: | HTML Attribute |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |
Views: | 45 |
Reffered: https://www.w3schools.com/tags/att_selected.asp