ok, I have this simple select2 which needs tagging support. My code :-
<select name="x1" id="x1" style="width: 20%">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
JS :-
$(document).ready(function(){
$("#x1").select2({
tags: true
});
});
My select2 should have tagging support, but it doesn't happen with my code. What wrong am I doing? Jsfiddle :- https://jsfiddle.net/u4euvsw0/
You have to add "multiple" attribute to make it works
<select name="x1" id="x1" style="width: 20%" multiple="multiple">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With