softare development

Multiple Select Dropdown in HTML

The multiple select dropdown specifies that multiple options can be selected at once.

The <select> tag in HTML allows users to select one or more options from a list of predefined options. To allow for multiple selections, you can add the multiple attribute to the <select> tag.

This is done by add the attribute multiple in the select tag.

The multiple attribute is a boolean attribute.

Selecting multiple options vary in different operating systems and browsers:

  • For windows: Hold down the control (ctrl) button to select multiple options
  • For Mac: Hold down the command button to select multiple options

Select Dropdown Example

<form>
  <label for="cars">Choose a car:</label>
  <select name="cars" id="cars" multiple>
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="opel">Opel</option>
    <option value="audi">Audi</option>
  </select>
</form>
multiple select dropdown

One major drawback of using this method is due to the different ways of doing this on both Windows and iOS, and because you have to inform the user that multiple selection is available, it is advisable to use checkboxes instead.

Download our mobile and learn HTML, CSS, Javascript, React, etc

Start learning how to code

Recent Posts

Service Workers in JavaScript: An In-Depth Guide

Service Workers are one of the core features of modern web applications, offering powerful capabilities…

1 week ago

What are Database Driven Websites?

A database-driven website is a dynamic site that utilizes a database to store and manage…

2 weeks ago

How to show Toast Messages in React

Toasts are user interface elements commonly used in software applications, especially in mobile app development…

2 weeks ago

Exploring the Relationship Between JavaScript and Node.js

JavaScript has long been synonymous with frontend web development, powering interactive and dynamic user interfaces…

3 weeks ago

Key Differences Between Tailwind CSS and CSS3

Introduction: In the world of web development, CSS (Cascading Style Sheets) plays a crucial role…

4 weeks ago

Why Everybody is Learning JavaScript Right Now

JavaScript has emerged as a ubiquitous programming language, powering the modern web and extending its…

4 weeks ago