1$(document).ready(function() {
2 $("#menuOption1").select2({dropdownParent: "#menuOption1-container"});
3 $("#menuOption2").select2({dropdownParent: "#menuOption2-container"});
4});
5
1$(".js-example-basic-multiple-limit").select2({
2 maximumSelectionLength: 3
3});
1<span id="menuOption1-container">
2 <select id="menuOption1">
3 <option value="1"> One </option>
4 <option value="2"> Two </option>
5 <option value="3"> Three </option>
6 <option value="4"> Four </option>
7 <option value="5"> Five </option>
8 </select>
9</span>
10
11<span id="menuOption2-container">
12 <select id="menuOption2">
13 <option value="a"> Vowel a </option>
14 <option value="e"> Vowel e </option>
15 <option value="i"> Vowel i </option>
16 <option value="o"> Vowel o </option>
17 <option value="o"> Vowel u </option>
18 </select>
19</span>
20
1#menuOption1-container .select2-results__option--highlighted {
2 background-color: #50831F !important;
3}
4
5#menuOption2-container .select2-results__option--highlighted {
6 background-color: #28915F !important;
7}
8