I've used Select2 plugin for tag input. Here is the fiddle of my basic work. I need showing "used number" of each options/tags at dropdown box like this way:
I've created a class for that number in my CSS (.used-number
). But, I don't understand how can I add that number for each options at my HTML file. Is there a way to add those something like this(or any other way):
$(".tag").select2({
data:[{tag: 'red',text:'3',className: 'used-number'},{tag: 'green',text:'12',className: 'used-number'},{tag: 'blue',text:'5', className: 'used-number'},{tag: 'black',text:'7'}]
});
});