In this tutorial, we will be looking at how to build a dropdown menu using HTML. A dropdown menu is used to show additional information on a menu to the user. Below is a simple HTML code snippet of the dropdown.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Dropdown Example</title>
</head>
<body>
<h2>HTML Dropdown </h2>
<label for="cars">Choose a car:</label>
<select id="cars" name="cars">
<option value="toyota">Toyota</option>
<option value="tesla">Tesla</option>
<option value="ram">Ram</option>
<option value="audi">Audi</option>
</select>
</body>
</html>
Here is the output.
Try it yourself.