I am using Select2 jQuery Plugin.
https://select2.github.io/ for reference
When I am using the multiple dropdown option. The result of selec
You can add this code after initializing select2
$('select').on('select2:close', function (evt) {
var uldiv = $(this).siblings('span.select2').find('ul')
var count = $(this).select2('data').length
if(count==0){
uldiv.html("")
}
else{
uldiv.html("- "+count+" items selected
")
}
Ref: jsfiddle
Reference to select2 events: Here
Edit:
If you want to display a blank when user deselects everything,
Use this fiddle: here
Edit:
Updated to remove flaw in deselection of data and changed it to main answer.
Fiddle: here