Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizWhen writing in HTML, the <select> tag is an inline element used to designate a control that presents a drop-down menu of options. The options in the list are defined by the <option> tag and grouped together using <optgroup>. The following sections contain information about the <select> tag, including an example of it in use, and related attributes and browser compatibility.
NoteThe <select> tag belongs to a group of tags called form elements.
Example of <select> code<select>
If you hover your mouse cursor over the right side of the BOX, a down arrow appears. Click this arrow to choose your favorite animal.
In addition to having a drop-down box, a larger select box allows more options or all available options to show using the size attribute. Below we added size="10" to the select tag to allow ten items to FIT in the box.
CatDogCrowEagleRaptorTyrannosaurusBrachiosaurusTipWe've also added multiple to the select tag to allow multiple items to be selected in the above box. To select multiple items, hold down the Ctrl on the keyboard and click each item you want to select.
AttributesWithin an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <select> tag, and a description of each.
Attribute | Description |
---|---|
autofocus | Designates that the drop-down list should automatically be FOCUSED upon the page loading. |
disabled | Disables the drop-down list. |
form | Designates the form(s) to which the <select> element belongs. |
multiple | Designates that more than one option may be selected from the list. |
name | Designates a name for the drop-down list. |
require | Designates that the USER is required to select a value before the form is submitted. |
size | Specifies the number of visible options in a drop-down list. |
Edge | Internet Explorer | Firefox | Safari | Opera | Chrome |
---|---|---|---|---|---|
All versions | All versions | All versions | All versions | All versions | All versions |
Turn Your Knowledge into Earnings.
Ever curious about what any word really means? Dictionary has got them all listed out for you to explore. Simply,Choose a subject/topic and get started on a self-paced learning journey in a world of word meanings and translations.
Write Your Comments or Explanations to Help Others