Answer the question
In order to leave comments, you need to log in
Why does select2 only apply to the last element?
Good day,
I have several selects and I want to use select2 for all of them
This is how the html looks like
<select class="select2 form-control" multiple="multiple" data-select2-id="select2-with-tags">
<option>1</option>
</select>
<select class="select2 form-control" multiple="multiple" data-select2-id="select2-with-tags">
<option>1</option>
</select>
<select class="select2 form-control" multiple="multiple" data-select2-id="select2-with-tags">
<option>1</option>
</select>
<select class="select2 form-control" multiple="multiple" data-select2-id="select2-with-tags">
<option>1</option>
</select>
$(".select2").select2()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question