Drop down menu provides a list of options to choose from. The HTML <select> tag is used to create a drop down list.
When the number of options in a drop-down list is large, fixing the number of visible items may be useful. This can be done by using the “size” attribute of <select> tag.
In the following example, 2 items are visible at a time because the value of the size attribute is set to 2.
In the above example, only one item can be selected from the list. To enable multiple selections, a “multiple” attribute is used. In the following example, multiple options can be selected by holding the Ctrl button (Windows) or Command (Mac):
- How to avoid dropdown menu to close menu items on clicking inside ?
- How to Add Image into Dropdown List for each items ?
- HTTP headers | Access-Control-Allow-Credentials
- HTTP headers | Access-Control-Allow-Origin
- HTTP headers | Access-Control-Allow-Headers.
- HTTP headers | Allow
- HTTP headers | Timing-Allow-Origin
- HTTP headers | Access-Control-Allow-Methods
- How to allow access outside localhost in AngularJS ?
- How to Fix a 401 Unauthorized Error?
- How to fix the height of rows in the table?
- How to fix the width of columns in the table ?
- Underscore.js _.fix() Method
- Lodash _.fix() Method
- How to fix SSL_ERROR_RX_RECORD_TOO_LONG on Mozilla Firefox ?
- How to select all visible or hidden elements in a HTML page using jQuery ?
- How to remove arrow in dropdown in Bootstrap ?
- How to style a dropdown using CSS?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.