cdn

Select2

Released —Installed

jQuery replacement for select boxes: search, tagging, remote data and infinite scrolling.

How to include

Requires jQuery. select2.full.min.js bundles extra adapters (e.g. containerCss, dropdownCss); use select2.min.js for the core build. Translations live in js/i18n/.

<link rel="stylesheet" href="https://cdn.roste.org/select2/latest/css/select2.min.css" />
<script src="https://cdn.roste.org/jquery/latest/jquery.min.js"></script>
<script src="https://cdn.roste.org/select2/latest/js/select2.full.min.js"></script>
<script>
  $("#my-select").select2();
</script>

Download zip


Single select with search

<select id="country"><option></option>…</select>
<script>
  $("#country").select2({
    placeholder: "Select a country…",
    allowClear: true
  });
</script>

Multi-select with tagging

<select id="langs" multiple>…</select>
<script>
  $("#langs").select2({
    tags: true,
    tokenSeparators: [",", " "]
  });
</script>