Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options.
- In your language
- Remote data support
- Fully extensible
- Dynamic item creation
- Full browser support
Using Select2 from a CDN
A CDN (content delivery network) is the fastest way to get up and running with Select2!
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
Single select boxes
Select2 was designed to be a replacement for the standard
<select> box that is displayed by the browser. By default it supports all options and operations that are available in a standard select box, but with added flexibility.
<select class="js-example-basic-single" name="state"> <option value="AL">Alabama</option> ... <option value="WY">Wyoming</option> </select>
Select2 will register itself as a jQuery function if you use any of the distribution builds, so you can call
.select2() on any jQuery selector where you would like to initialize Select2.