Multiple Select With Dropdown List – multiselect

Category: Form , Javascript | January 28, 2019
Author: varundewan
Views Total: 971
Official Page: Go to website
Last Update: January 28, 2019
License: MIT

Preview:

Multiple Select With Dropdown List – multiselect

Description:

A vanilla JavaScript multi-select plugin that transforms the normal multi-select element into a user-friendly tags input.

The users are allowed to select multiple options from the dropdown select. Click the ‘X’ button to remove the selected option.

How to use it:

Import the main JavaScript and Stylesheet into the document.

<link rel="stylesheet" href="css/style.css">
<script src="js/index.js"></script>

Attach the plugin to a multi-select element and done.

<select multiple="multiple" id="myMulti">
  <option>CSS</option>
  <option>SCRIPT</option>
  <option>COM</option>
  <option>jQuery</option>
  <option>HTML5</option>
</select>
var myDrop = new drop({
    selector:  '#myMulti'
});

Specify an array of preselected options.

var myDrop = new drop({
    selector:  '#myMulti'
    preselected: [0, 2]
});

You Might Be Interested In:


Leave a Reply