Skip to content

Commit b0e5197

Browse files
committed
Merge branch 'patch-1' of https://github.com/marcaparent/select2
2 parents 0459ac8 + a587e39 commit b0e5197

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

docs/_includes/examples/tags.html

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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>

0 commit comments

Comments
 (0)