<select name="Food">
<option value ="apples">Apples</option>
<option value ="bananas">Bananas</option>
<option value ="oranges">Oranges</option>
</select>
The above example demonstrates usage of the <select>
element.
The <select>
element represents a control for selecting amongst a set of options. This is typically rendered as a drop down menu containing a list of options.
In a <select>
list, each option is represented by an <option>
element. If there are many items, they can (optionally) be grouped using the <optgroup>
element.
The <select>
element accepts the following attributes (as well as the global HTML attributes):
autofocus
disabled
form
<form>
multiple
name
form.elements
API)required
size