The HTML <form> Elements
The HTML <form> element can contain one or more of the following form elements:
Go to Forms (Core Concept)
<input>
<label>
<textarea>
<button>
→ View Forms Core Concepts (input, label, textarea, button)
Details of the following tags are on this page. For details of the above tags, go to Form(core concept).
<select>
<fieldset>
<legend>
<datalist>
<output>
<option>
<optgroup>
The <select> Element
The <select> element defines a drop-down list:
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<!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> </form> </body> </html> |
Result
The select Element
The select element defines a drop-down list: