HTML <select> tag
HTML <select> tag
The <select>
tag specifies a drop-down that provides a menu of options.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body>
<select>
<option>Apple</option>
<option>Banana</option>
<option>Cherry</option>
<option>Dates</option>
</select>
</body>
</html>
Attributes
The following are the attributes of <select> tag. Also try Global attributes.
Attribute | Value | Explanation |
---|---|---|
autofocus | - | Specifies that the drop-down list should automatically get focus when the page loads. |
disabled | - | Specifies that the user cannot interact with the drop-down list. |
form | form_id | Specifies that the drop-down list belongs to one or more forms. |
multiple | - | Specifies that multiple options can be selected in the drop-down list. |
name | text | Specifies the name for the drop-down list. |
required | - | Specifies that an option with a non-empty string value must be selected when submitting the form. |
size | number | Specifies the number of visible options in a drop-down list. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.