Advertisement
Home Open Editor ❯

HTML multiple Attribute

Example

<form action="action.php">
  <label for="email">Enter a emails:</label>
  <input type="email" id="email" name="emails" multiple><br><br>
  <input type="submit">
</form>

Try this code ❯

Meaning

The multiple attribute allows the selection of multiple items.

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


Standard Syntax

HTML: <element multiple>
XHTML: <element multiple="multiple">


Applies to:

The multiple attribute can be used on the following element:

Element Attribute
<input> multiple
<select> multiple

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.

More Examples

<select> 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 ❯

Home Open Editor ❯
Advertisement