Create a drop-down list with four options:
![]()
The <select> tag is supported in all major browsers.
The <select> element is used to create a drop-down list.
The <option> tags inside the <select> element define the available options in the list.
HTML5 has some new attributes.
Tip: The <select> element is a form control and can be used in a form to collect user input.
New : New in HTML5.
| Attribute | Value | Description |
|---|---|---|
| autofocusNew | autofocus | Specifies that the drop-down list should automatically get focus when the page loads |
| disabled | disabled | Specifies that the drop-down list should be disabled |
| formNew | form_id | Defines one or more forms the select field belongs to |
| multiple | multiple | Specifies that multiple items can be selected at once |
| name | text | Defines a name for the drop-down list |
| size | number | Defines the number of visible options in the drop-down list |
The <select> tag also supports the Global Attributes in HTML5.
The <select> tag also supports the Event Attributes in HTML5.
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|