jQuery Searchable Select Menu Plugin For Bootstrap - Dropselect

File Size: 46.2 KB
Views Total: 7258
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
jQuery Searchable Select Menu Plugin For Bootstrap - Dropselect

Dropselect is a jQuery plugin that converts the normal Bootstrap dropdown component into a searchable, multi-select dropdown menu.

Basic usage:

1. First you need to include both jQuery library and Twitter's Bootstrap framework in the html document.

<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery-3.1.0.slim.min.js"></script>
<script src="bootstrap.min.js"></script>

2. Then download and include the Bootstrap dropselect plugin's files in the document.

<link href="css/bootstrap-dropselect.css" rel="stylesheet">
<script src="js/bootstrap-dropselect.js"></script>

3. Create a normal Bootstrap dropdowm as this:

<div class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">
    <span id="dropselect-label">Click Me!</span>
    <span class="caret"></span>
  <ul class="dropdown-menu" id="dropselect" role="menu">
    <li class="dropdown-header">Select Menu</li>
    <li><a href="#">Select Menu #1</a></li>
      <a href="#">
        <strong>Select Menu #2</strong><br />
        <small class="text-muted">Content description here...</small>
      <a href="#">
        <i class="glyphicon glyphicon-arrow-right"></i> Select Menu #3
    <li data-value="selected_value" selected><a href="#">Select Menu #4</a></li>
    <li data-value="something_value"><a href="#">Select Menu #5</a></li>
    <li class="divider"></li>
    <li><a href="#">Select Menu #6</a></li>

4. Finally, just the call the plugin on the top container and done.


5. Options and callback functions available:

  // event hooks
  // item specific event hooks
  onselect: function(e, item) {},
  onunselect: function(e, item) {},
  ontoggle: function(e, item) {},

  // global event hooks
  onchange: function(e) {},
  onclear: function(e) {},
  onload: function(e) {},
  onhidden: function(e) {},

  // item source
  items: 'markup',

  multiselect: false,
  toggle: true,
  autohide: false,
  icons: {
    show: true,
    selected: 'glyphicon glyphicon-ok',
    clear: 'glyphicon glyphicon-remove',
    dash: 'glyphicon glyphicon-minus'
  width: 300,
  clear: {
    show: true,
    text: 'Clear selected'
  filter: {
    show: true,
    placeholder: 'Search',
    casesensitive: false,
    noresult: 'No results found'

6. API methods:

var myMenu = $('#dropselect').dropselect()

// toggles the selected state of an item

// clear all selected items

// manually selects an item given by an index number

// manually unselects an item given by an index number

// shows the loading indicator

// hides the loading indicator

// completely hides the dropdown

// Returns { item: ITEM_VALUE, text: ITEM_TEXT, icon: DEFAULT_ITEM_ICON, $element: LI_ELEMENT }

// destroys the plugin

Change log:


  • v1.1.4

This awesome jQuery plugin is developed by lodev09. For more Advanced Usages, please check the demo page or visit the official website.