Chapter 8
Moving Away from the <input> Element
Section 11
Dropdown Controls and the Select Box
With HTML, you can easily create dropdown lists of items to get user input into HTML forms. A select box is one type of dropdown menu and it provides the ability to list down various options in the form of a dropdown list, where the user can select one or more options. Remember, the name attribute is needed to reference the form data after the form is submitted (if you omit the name attribute, no data from the list will be submitted to the server). The <option> tags inside the <select> element define the available options in the drop-down list, and the <optgroup> element can create nice headings for a group of items to select.