Skip to content

Commit

Permalink
Added docs section for HTML labels
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kevin-brown committed Apr 24, 2016
1 parent 31e7a1d commit 3bc7f4a
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions docs/_includes/examples/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,39 @@ <h2 id="multiple">Multiple select boxes</h2>
<option value="WY">Wyoming</option>
</select>
{% endhighlight %}
</section>

</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>

0 comments on commit 3bc7f4a

Please sign in to comment.