Select Menu

suggest change

The <select> element generates a drop-down menu from which the user can choose an option.

<select name="">
  <option value="1">One</option>
  <option value="2">Two</option>
  <option value="3">Three</option>
  <option value="4">Four</option>
</select>

Changing the Size

You can change the size of the selection menu with the size attribute. The value must be an integer greater than zero. A size of 1 displays the standard drop-down menu. A size greater than 1 converts the drop-down into a list box showing that many lines, with one option per line and a scrollbar to scroll through the available options. size="0" is invalid.

<select name="" size="4"></select>

Multi-option Selection Menus

By default, users can only select a single option. Adding the multiple attribute allows users to select multiple options at once and submit all selected options with the form. Using the multiple attribute automatically converts the drop-down menu into a box as if it had a size defined. The default size when this occurs is determined by the specific browser you are using, and it is not possible to change it back to a drop-down style menu while allowing multiple selections.

<select name="" multiple></select>

When using the multiple attribute, the control is a list box rather than a drop-down. Omitting size leaves the height up to the browser. size="1" explicitly makes that box one row high. size="0" is invalid.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents