Learn html - html tutorial - select tag in html - html examples - html programs
- The <select> tag used to create a drop-down list.
- The <option> tag used to specify the options in the drop-down list.
- <select> tag belongs to Flow content, Phrasing content, Interactive content, Listed, Labelable, Resettable, and Submittable form-associated element.
- <select> tag supports Global Attributes and Event Attributes.
Syntax for <select> tag:
Differences between HTML 4.01 and HTML5 for <select> tag:
HTML 4.01
- HTML4 <select> tag does not support the following attributes autofocus, form and required.
HTML5
- HTML5 <select> tag has some new attributes.
Sample Coding for <select> tag:
Code Explanation for <select> tag:
- <select> tag used to display a drop-down list.
- <option> tag used to specify the list of content.
Output of <Select> tag:
- The output displays the “WikitechyHTML”, “WikitechyCSS”, and “WikitechyPHP” as a drop-down list.
Attribute List:
Attribute |
Value |
HTML4 |
HTML5 |
Description |
autofocus |
autofocus |
No |
Yes |
Specifies that the drop-down list should automatically get focus when the page loads |
disabled |
disabled |
Yes |
Yes |
Specifies that a drop-down list should be disabled |
form |
form_id |
No |
Yes |
Defines one or more forms the select field belongs to |
multiple |
multiple |
Yes |
Yes |
Specifies that multiple options can be selected at once |
name |
name |
Yes |
Yes |
Defines a name for the drop-down list |
required |
required |
No |
Yes |
Specifies that the user is required to select a value before submitting the form |
size |
number |
Yes |
Yes |
Defines the number of visible options in a drop-down list |
Browser Support for <select> tag:
Related Searches to select tag in html
html select selected
html select default
html select onchange
html select placeholder
html form select
select tag rails
html select multiple
html option
html form select option
html tutorialshtml editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list