Advertisement
Home Open Editor ❯

HTML <select> multiple Attribute

Example

<label for="lang">Choose your option:</label>

<select name="language" id="lang" multiple>
  <option value="HTML">HTML</option>
  <option value="CSS">CSS</option>
  <option value="JavaScript">JavaScript</option>
</select>

Try this code ❯

Meaning

The multiple attribute allows the selection of multiple items in the selection list.

The default is single-item(1) selection. Under XHTML, this attribute must have its value set to multiple="multiple".


Standard Syntax

<select multiple>
  <option>text</option>
</select>


Advertisement

Attribute Values

Value Description
multiple This is a boolean attribute, the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
Home Open Editor ❯
Advertisement