HTML multiple Attribute

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Forms & Input

Introduction

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.

What You’ll Learn

01

Boolean attr

Present = true.

02

<select>

Multi-select list.

03

type="file"

Many files.

04

Ctrl / Cmd

Desktop picking.

05

Form submit

Many values.

06

.multiple JS

Toggle at runtime.

Purpose of multiple Attribute

The 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.

💡
Not only for <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.

📝 Syntax

Add the boolean multiple attribute to supported elements:

multiple.html
<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>

Syntax Rules

  • Boolean attribute—write multiple alone; presence enables multi-value mode.
  • Valid on <select>, <input type="file">, and <input type="email">.
  • JavaScript IDL property: element.multiple = true (boolean).
  • Pair multi-select with size for better UX (visible rows).
  • Server must handle multiple submitted values or files for the same field name.
  • Not valid on radio, checkbox groups use separate inputs instead.

💎 Values

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.
  • Attribute absent — Single selection or single file only.
  • JavaScript: selectEl.multiple = true or false.
multiple-js.html
document.getElementById("dynamicSelect").multiple = true;

document.getElementById("fileInput").multiple = false;

⚡ Quick Reference

Use caseMarkupNotes
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 onlyOmit multipleDefault behavior
JS enableel.multiple = trueBoolean property
Images onlymultiple accept="image/*"With file input

Applicable Elements

Element / typeSupported?Notes
<select>YesMost common multi-select use
<input type="file">YesMultiple file picker
<input type="email">YesMultiple email addresses
<input type="text">NoNot a valid attribute
checkbox / radioNoUse separate inputs with same name

multiple on select vs file vs checkboxes

ApproachElementBest for
multiple on <select>Dropdown / list boxMany options from one long list
multiple on type="file"File pickerUploading several documents or images
Several <input type="checkbox">Checkbox groupVisible multi-choice without Ctrl/Cmd
Custom UI + hidden inputsJavaScript widgetsTag pickers, modern multi-select components

Examples Gallery

Multi-select fruit list, multiple file upload, and toggling select.multiple with JavaScript.

👀 Live Preview

Multi-select with live selection display:

Selected: (none)

Example — Multi-Select Dropdown

Let users choose several fruits from one list:

select-multiple.html
<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>
Try It Yourself

How It Works

Without multiple, only the last clicked option stays selected. With it, each chosen <option> is included in the form data.

Example — Multiple File Upload

Accept several files in one input:

file-multiple.html
<label for="photos">Upload photos:</label>

<input type="file" id="photos" name="photos" multiple accept="image/*">
Try It Yourself

How It Works

The files property on the input returns a FileList. With multiple, that list can contain more than one file.

Dynamic Values with JavaScript

Toggle multi-select mode when requirements change:

dynamic-multiple.html
<select id="dynamicSelect" name="colors">

  <option value="red">Red</option>

  <option value="blue">Blue</option>

</select>



<script>

  document.getElementById("dynamicSelect").multiple = true;

</script>
Try It Yourself

How It Works

Assigning true to select.multiple or fileInput.multiple switches the control to multi-value mode without reloading the page.

♿ Accessibility

  • Explain multi-select interaction — Tell users to hold Ctrl or Command, or use checkboxes for clearer multi-choice UX.
  • Use size on multi-select — A visible list box is easier to discover than a collapsed dropdown with hidden multi-select behavior.
  • Label file inputs clearly — e.g. “Upload one or more photos” when multiple is set.
  • Announce selections — Custom multi-select widgets should manage focus and use ARIA patterns; native <select multiple> relies on OS behavior.
  • Consider checkboxes — For small option sets, visible checkboxes are often more accessible than Ctrl/Cmd multi-select.

🧠 How multiple Works

1

Author adds multiple

Boolean on control.

Markup
2

User picks values

Several options/files.

Input
3

Form submits

Many name=value pairs.

Submit
=

Server gets list

Multiple values collected.

Browser Support

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.

HTML5 · Fully supported

Universal multi-value controls

Chrome, Firefox, Safari, and Edge honor multiple on select and file inputs.

99% Browser support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
multiple on select and file input 99% supported

Bottom line: Safe for multi-select lists and batch file uploads in production.

💡 Best Practices

✅ Do

  • Use size on multi-select for visible options
  • Explain Ctrl/Cmd multi-select in help text
  • Use multiple on file inputs for gallery uploads
  • Validate file count and size on the server
  • Consider checkboxes for small, critical multi-choice sets

❌ Don’t

  • Assume users know Ctrl/Cmd without instructions
  • Put multiple on unsupported input types
  • Forget server-side handling for multiple values
  • Rely on native multi-select for complex tag UIs without testing a11y
  • Upload unlimited files without size or type checks

Conclusion

The 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.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about multiple

Bookmark these before building multi-choice forms.

5
Core concepts
📄 02

select & file

Main elements.

Scope
03

Ctrl / Cmd

Multi-click UX.

Select
⚙️ 04

.multiple JS

true / false.

Dynamic
📤 05

Server list

Many values.

Submit

❓ Frequently Asked Questions

It enables selecting more than one option from a <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.
On desktop, hold Ctrl (Windows/Linux) or Command (macOS) while clicking. Use size to show a list box instead of a collapsed dropdown.
element.multiple = true or false on HTMLSelectElement or HTMLInputElement.
The form sends multiple entries with the same field name, or multiple files under one file input name. Server code must expect a list or array.
No. Checkboxes are separate inputs. multiple on <select> is one control that returns several selected options. Checkboxes are often clearer for accessibility.

Allow multiple selections with the multiple attribute

Practice multi-select lists, file uploads, and dynamic .multiple in the Try It editor.

Try multi-select example →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful