Drop-down list in HTML

Drop-down list is sometimes called pop-up menu, one of the flexible and convenient form elements. Depending on the list settings, you can select one or more values. The advantage of the list is its compact size, it takes up only one field, and to view the entire list one needs to click on it. However, this is at the same time its disadvantage, because the user does not immediately see all the options.
Drop down list is created as follows.
<select parameters> <option parameters> Choice 1</option> <option> Choice 2</option> <option> Choice 3</option> </select>
Tags select and option have the following parameters (table 1).
Table 1. Drop-down list parameter.
Parameter | Description |
---|---|
name | Name of the field. Designed for the form handler to identify the list. |
size | The number of visible items in the list. By default, one item. |
multiple | This parameter allows to select multiple items in the list. The selection is made with keys Control or Shift. |
Parameter | Description |
selected | Displayed field by default. |
value | This parameter specifies what will be sent to the server if certain item is selected. |
How to create the list using tags select and option is shown in example 1.
Example 1. Drop-down list.
<form action="/cgi-bin/handler.cgi"> <b>What do you think the abbreviation "OS" stands for?</b><br> <select name="OS"> <option>Officer Standpoint</option> <option>Operating System</option> <option>Obese Singularity</option> </select> </form>
The result is shown below.