HTML select Tag

HTML <select>Tag: The HTML<select>tag creates a drop-down list. And the html  select tag belongs to Flow content, Phrasing content, Interactive content, Listed, Labelable, Resettable, and Submittable form-associated element.

HTML <select>Tag

This HTML select tag supports both the global and the event attributes.

Syntax: <select>Text</select>

Browser compatibility

The HTML <select> tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example:

<!DOCTYPE html>
<html>
<body>
<select>
  <option value="html">html</option>
  <option value="css">css</option>
  <option value="java">java</option>
  <option value="c">c</option>
</select> 
</body>
</html>

Output:

html select tag

Attributes that are supported by the <select> tag

Attribute Value Description
disabled disabled Specifies that a drop-down list should be disabled
multiple multiple Specifies that multiple options can be selected at once
name name Defines a name for the drop-down list
size number Defines the number of visible options in a drop-down list