How to Create a Dropdown Menu in HTML

html menu 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.

html dropdown

Try it yourself.

Leave a Comment

Your email address will not be published. Required fields are marked *