HTML <select> tag

Updated: 11/13/2018 by Computer Hope

HTML select tagWhen 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 can be grouped together using <optgroup>. The following sections contain information about the <select> tag, including an example of it in use, as well as related attributes and browser compatibility.

Note: The <select> tag belongs to a group of tags called form elements.

Example of <select> code

<optgroup label="Mammals">
<optgroup label="Birds">
<optgroup label="Dinosaurs">

Example result

Choose your favorite animal from this list:

If you hover your mouse cursor over the right side of the box, a down arrow will appear. Click this arrow to choose your favorite animal.


Within 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, as well as 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

Additional form elements

Browser, Compatibility, Web design terms