The HTML5 select Tag
The HTML5 <select> tag is primarily used in creating a drop down list within an HTML document. This drop down list will serve as options that the users can choose from. When the HTML5 <select> tag is placed within the <select> element, this provides the available options for the list. This can be used along within a form so that data can be collected efficiently from the users.
The HTML5 <select> tag is accepted by all major websites like Internet Explorer, Google Chrome, Safari, Opera and Firefox. It is also well-suited for Global Attributes and Event Attributes in HTML5.
The attributes for HTML5 <select> tag include the follwing:
Attribute |
Value |
Description |
autofocus (New) |
autofocus |
This is the key in enabling the web browser to automatically focus on the drop down list |
disabled |
disabled |
This is used when it is necessary to disable the drop down list |
form (New) |
form_id |
It is the key in specifying the exact form or forms that the select field should work for |
multiple |
multiple |
It enables multiple selection of different items |
name |
text |
It is used in providing a name for the list |
size |
number |
It allows the author to specify the number of options in the list |