1
0
mirror of synced 2024-11-25 14:26:03 +03:00

Added docs section for HTML labels

This will make it easier in the future to test that we support labels,
and it tells people who are looking to confirm that we support labels
that we in fact do.
This commit is contained in:
Kevin Brown 2016-04-23 20:36:39 -04:00
parent 31e7a1d4c5
commit 3bc7f4ac78

View File

@ -59,6 +59,39 @@ $(".js-example-basic-multiple").select2();
<option value="WY">Wyoming</option>
</select>
{% endhighlight %}
</section>
<h2>Select boxes with labels</h2>
<p>
You can, and should, use a <code>&lt;label&gt;</code> with Select2, just like any other <code>&lt;select&gt</code> element.
</p>
<div class="s2-example">
<p>
<label for="id_label_single">
Click this to highlight the single select element
<select class="js-example-basic-single js-states form-control" id="id_label_single"></select>
</label>
</p>
<p>
<label for="id_label_multiple">
Click this to highlight the multiple select element
<select class="js-example-basic-multiple js-states form-control" id="id_label_multiple" multiple="multiple"></select>
</label>
</p>
</div>
{% highlight html linenos %}
<label for="id_label_single">
Click this to highlight the single select element
<select class="js-example-basic-single js-states form-control" id="id_label_single"></select>
</label>
<label for="id_label_multiple">
Click this to highlight the multiple select element
<select class="js-example-basic-multiple js-states form-control" id="id_label_multiple" multiple="multiple"></select>
</label>
{% endhighlight %}
</section>