YouTip LogoYouTip

Att Select Multiple

# HTML ` element. It allows users to select more than one option from a drop-down list or scrollable selection box. --- ## Quick Example The following example demonstrates a basic drop-down list that allows multiple selections: ```html ``` --- ## Browser Support | Attribute | Chrome | Edge/IE | Firefox | Safari | Opera | | :--- | :--- | :--- | :--- | :--- | :--- | | `multiple` | Yes (All versions) | Yes (All versions) | Yes (All versions) | Yes (All versions) | Yes (All versions) | The `multiple` attribute is fully supported by all modern web browsers. --- ## Definition and Usage * The `multiple` attribute is a **boolean attribute**. When present, it specifies that the user can select multiple options in the list. * When the `multiple` attribute is used, most browsers will display a scrollable list box instead of a single-line drop-down menu. * The size of the list box can be adjusted using the `size` attribute (e.g., ` ``` ### HTML vs. XHTML Differences In XHTML, attribute minimization is forbidden. The `multiple` attribute must be defined with its value explicitly declared: ```xml

``` ### 2. Getting Selected Values with JavaScript You can easily retrieve the selected values using JavaScript: ```html Get Multiple Select Values


``` --- ## User Experience (UX) Considerations While the `multiple` attribute is highly functional, it has some notable usability drawbacks: 1. **Hidden Controls:** Users might not know they can select multiple options unless explicit instructions are provided. 2. **Complex Interaction:** Requiring users to hold down `Ctrl` or `Command` is not intuitive for non-technical users and is prone to accidental clicks that can clear previous selections. 3. **Mobile Limitations:** While mobile browsers handle this natively, the experience varies significantly across different operating systems. ### Alternative Solution For a more user-friendly interface, consider using a list of **checkboxes** (``) instead of a multi-select dropdown, or use a modern JavaScript library (such as Select2, Choices.js, or Tom Select) to style the multi-select element into a searchable tag-based input.
← Att Select NameAtt Select Form β†’