HTML CSS examples for HTML Tag:option
The selected attribute is a boolean attribute to set if an option should be pre-selected when the page loads.
In XHTML, the selected attribute must be defined as <option selected="selected">.
The following code shows how to create A drop-down list with a pre-selected option:
<!DOCTYPE html> <html> <body> <select> <option value="css">CSS</option> <option value="java">Java</option> <option value="python">Python</option> <option value="a" selected>A</option> </select><!--from w ww . j a va 2 s . com--> </body> </html>