File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 < h1 id ="tags "> Tagging support</ h1 >
33
44 < p >
5- Select2 can be used to quickly set up fields used for tagging.
5+ Select2 can be used to quickly set up fields used for tagging.
66 </ p >
77
88 < p >
@@ -13,17 +13,39 @@ <h1 id="tags">Tagging support</h1>
1313
1414 < div class ="s2-example ">
1515 < p >
16- < select class ="js-example-tags form-control " multiple ="multiple ">
16+ < select class ="js-example-tags-multiple form-control " multiple ="multiple ">
1717 < option selected ="selected "> orange</ option >
1818 < option > white</ option >
1919 < option selected ="selected "> purple</ option >
2020 </ select >
2121 </ p >
2222 </ div >
2323
24+ {% highlight js linenos %}
25+ $(".js-example-tags-multiple").select2({
26+ tags: true
27+ })
28+ {% endhighlight %}
29+
30+ < p >
31+ Tagging can also be used on a single select element. Simply remove the
32+ < code > multiple="multiple"</ code > attribute from your HTML markup.
33+ </ p >
34+
35+ < div class ="s2-example ">
36+ < p >
37+ < select class ="js-example-tags form-control ">
38+ < option selected ="selected "> orange</ option >
39+ < option > white</ option >
40+ < option > purple</ option >
41+ </ select >
42+ </ p >
43+ </ div >
44+
2445{% highlight js linenos %}
2546$(".js-example-tags").select2({
2647 tags: true
2748})
2849{% endhighlight %}
50+
2951</ section >
You can’t perform that action at this time.
0 commit comments