👀 Live Preview
Multi-select with live selection display:
Selected: (none)

The multiple attribute is a boolean HTML attribute that lets users pick more than one value from certain form controls. On <select>, it enables multi-select lists. On <input type="file">, it allows uploading several files in one action. On <input type="email">, it can accept multiple comma-separated addresses. Without multiple, those controls accept only a single choice or file. Add the attribute by writing multiple alone—no value is required.
Present = true.
Multi-select list.
Many files.
Desktop picking.
Many values.
Toggle at runtime.
multiple AttributeThe primary purpose of multiple is to collect several related choices in one form field. A skills picker might let users tag JavaScript, HTML, and CSS at once. A photo upload might accept five images without five separate inputs. The server receives multiple values under the same field name (or multiple files in one request).
On desktop browsers, multi-select lists typically require holding Ctrl (Windows/Linux) or Command (macOS) while clicking. Adding size="5" shows several visible rows, which makes multi-select more obvious than a collapsed dropdown.
<select>The old reference focused on dropdowns only. multiple is equally important on <input type="file"> for batch uploads and on type="email" for several addresses.
Add the boolean multiple attribute to supported elements:
<label for="fruits">Favorite fruits:</label>
<select id="fruits" name="fruits" multiple size="5">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="orange">Orange</option>
</select>
<label for="photos">Upload photos:</label>
<input type="file" id="photos" name="photos" multiple accept="image/*">
<label for="recipients">Email to:</label>
<input type="email" id="recipients" name="recipients" multiple>multiple alone; presence enables multi-value mode.<select>, <input type="file">, and <input type="email">.element.multiple = true (boolean).size for better UX (visible rows).radio, checkbox groups use separate inputs instead.The multiple attribute is a boolean—it has no meaningful string value:
multiple — Attribute present; multiple selections or files allowed.multiple="" — Also valid in HTML5; same as bare multiple.selectEl.multiple = true or false.document.getElementById("dynamicSelect").multiple = true;
document.getElementById("fileInput").multiple = false;| Use case | Markup | Notes |
|---|---|---|
| Multi-select list | <select multiple size="5"> | Ctrl/Cmd + click |
| Multiple files | <input type="file" multiple> | Batch upload |
| Several emails | <input type="email" multiple> | Comma-separated |
| Single only | Omit multiple | Default behavior |
| JS enable | el.multiple = true | Boolean property |
| Images only | multiple accept="image/*" | With file input |
| Element / type | Supported? | Notes |
|---|---|---|
<select> | Yes | Most common multi-select use |
<input type="file"> | Yes | Multiple file picker |
<input type="email"> | Yes | Multiple email addresses |
<input type="text"> | No | Not a valid attribute |
checkbox / radio | No | Use separate inputs with same name |
multiple on select vs file vs checkboxes| Approach | Element | Best for |
|---|---|---|
multiple on <select> | Dropdown / list box | Many options from one long list |
multiple on type="file" | File picker | Uploading several documents or images |
Several <input type="checkbox"> | Checkbox group | Visible multi-choice without Ctrl/Cmd |
| Custom UI + hidden inputs | JavaScript widgets | Tag pickers, modern multi-select components |
Multi-select fruit list, multiple file upload, and toggling select.multiple with JavaScript.
Multi-select with live selection display:
Selected: (none)
Let users choose several fruits from one list:
<label for="fruitSelection">Select fruits:</label>
<select id="fruitSelection" name="fruits" multiple size="5">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="orange">Orange</option>
<option value="grape">Grape</option>
</select>Without multiple, only the last clicked option stays selected. With it, each chosen <option> is included in the form data.
Accept several files in one input:
<label for="photos">Upload photos:</label>
<input type="file" id="photos" name="photos" multiple accept="image/*">The files property on the input returns a FileList. With multiple, that list can contain more than one file.
Toggle multi-select mode when requirements change:
<select id="dynamicSelect" name="colors">
<option value="red">Red</option>
<option value="blue">Blue</option>
</select>
<script>
document.getElementById("dynamicSelect").multiple = true;
</script>Assigning true to select.multiple or fileInput.multiple switches the control to multi-value mode without reloading the page.
size on multi-select — A visible list box is easier to discover than a collapsed dropdown with hidden multi-select behavior.multiple is set.<select multiple> relies on OS behavior.Boolean on control.
Several options/files.
Many name=value pairs.
Multiple values collected.
The multiple attribute on <select> and <input type="file"> is fully supported in all modern browsers. Email multiple support is also widely available in current engines.
Chrome, Firefox, Safari, and Edge honor multiple on select and file inputs.
Bottom line: Safe for multi-select lists and batch file uploads in production.
size on multi-select for visible optionsmultiple on file inputs for gallery uploadsmultiple on unsupported input typesThe multiple attribute unlocks multi-value form controls with a single boolean flag. On <select> it powers multi-select lists; on file inputs it enables batch uploads; on email fields it accepts several addresses.
Pair it with clear labels and instructions, handle multiple submitted values on the server, and use JavaScript .multiple when you need to switch modes dynamically.
multipleBookmark these before building multi-choice forms.
Present = on.
SyntaxMain elements.
ScopeMulti-click UX.
Selecttrue / false.
DynamicMany values.
Submit<select>, choosing multiple files from a file input, or entering several email addresses. It is a boolean attribute.<select>, <input type="file">, and <input type="email">. Not valid on text, number, or radio inputs.size to show a list box instead of a collapsed dropdown.element.multiple = true or false on HTMLSelectElement or HTMLInputElement.multiple on <select> is one control that returns several selected options. Checkboxes are often clearer for accessibility.Practice multi-select lists, file uploads, and dynamic .multiple in the Try It editor.
5 people found this page helpful