Horje
How to create HTML <select> Element

The <select> element defines a drop-down list:


Full Example of <select> Element

The select element defines a drop-down list:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>The select Element</h2>

<p>The select element defines a drop-down list:</p>

<form action="/action_page.php">
  <label for="cars">Choose a car:</label>
  <select id="cars" name="cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="fiat">Fiat</option>
    <option value="audi">Audi</option>
  </select>
  <input type="submit">
</form>

</body>
</html>

Output should be:

Full Example of <select> Element





Category:
Web Tutorial
Sub Category:
HTML Form Elements
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference