W3Schools.com

HTML5 <select> Tag

Example

Create a drop-down list with four options:

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <select> tag is supported in all major browsers.


Definition and Usage

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.


Differences Between HTML 4.01 and HTML5

HTML5 has some new attributes.


Tips and Notes

Tip: The <select> element is a form control and can be used in a form to collect user input.


Attributes

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

Global Attributes

The <select> tag also supports the Global Attributes in HTML5.


Event Attributes

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