Module select

Module select 

Source
Expand description

Attribute names for select (<select>) elements.

§Purpose

The <select> element represents a control for selecting from a set of options, displayed as a dropdown menu or list box.

§Common Attributes

  • name: Form control name for submission
  • multiple: Allows selecting multiple options
  • size: Number of visible options (list vs dropdown)
  • required: Makes selection mandatory
  • disabled: Disables the control

§Example

<select name="country" required>
  <option value="">Select a country</option>
  <option value="us">United States</option>
  <option value="uk">United Kingdom</option>
</select>
<select name="tags" multiple size="5">
  <option>JavaScript</option>
  <option>Python</option>
  <option>Rust</option>
</select>

§WHATWG Specification

Constants§

AUTOCOMPLETE
The autocomplete attribute.
AUTOFOCUS
The autofocus attribute.
DISABLED
The disabled attribute.
FORM
The form attribute.
MULTIPLE
The multiple attribute.
NAME
The name attribute.
REQUIRED
The required attribute.
SIZE
The size attribute.