+ 3
Use the selected attribute to specify that the option should be pre-selected when page loads in HTML. You can try to run the following code to implement selectedattribute:
<!DOCTYPE html> <html>
<head>
<title>HTML selected attribute</title> Â Â </head>
<body>
<p>Here's the list of subjects. Select any one:</p>
<form><select name = "dropdown"> Â Â Â Â Â Â <option value = "Computer Architecture" selected>Computer Architecture</option> Â Â Â Â Â Â <option value = "Java">Java</option> Â Â Â Â Â Â <option value = "Discrete Mathematics">Discrete Mathematics</option> Â Â </select>
</form>
</body>
</html>
http://www.tutorialspoint.com/How-to-specify-that-an-option-should-be-pre-selected-when-the-page-loads-in-HTML



