HTML Element for Dropdown Lists | Generated by AI
Question: Which HTML element is used to create a dropdown list in a form?
Answer:
The correct HTML element for creating a dropdown list (also known as a select menu) in a form is <select>, used in combination with <option> elements for the individual choices.
Explanation:
- The
<select>element defines the dropdown list itself. - Inside it, multiple
<option>elements specify the selectable items. - Example:
<label for="cars">Choose a car:</label>
<select id="cars" name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
Since the provided options (A) B) C) D)) appear incomplete and one is listed as <dropdown>, which is not a valid HTML element, the standard and correct answer is <select>.
References:
- [MDN Web Docs -
- [W3Schools - HTML