Select2 is very famous jquery plugin for HTML Select control. Select2 also supports multi-value select boxes. Select2 is very easy to use and configurable.
Select2 provides you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options.
Also checkout other tutorials of select2,
- Part 1 – How to Integrate Chosen in HTML dropdown list
- Part 2 – How to Select All element of SELECT2
- Part 3 – How to add Custom message into Select2
How To Apply Select2 On HTML Select Element
as u can see, I have used
select2() method on HTML dropdown which id is
No i will tell you how to select all elements of multi select box
onClick() of particular option, ie. if you have option ‘all’ in multi select box and you need to select all element of multi select when the user select
Select All Options of select Box Using Select2
The following code need to use select all options of multi select box,
$('#selectId > option').prop("selected",true);