<select multiple>
<select multiple>
This uses no javascript at all, and is the old way of doing things, using a <select>
element with the multiple
attribute.
<select multiple name="state-select">
<option value="AL">Alabama</option>
[...]
<option value="WY">Wyoming</option>
</select>
Virtually none to speak of.
.checkselect
This uses no javascript at all, and is a new way of doing things. I am using CSS to emulate the <select multiple>
using a list, checkboxes, and labels while improving the usability and obvious method of use.
<select multiple>
means those familiar with it will understand it<select multiple>
via the :checked
pseudo-selector and the adjacent sibling combinator<input type="checkbox">
and <label>
elements<ul class="checkselect">
<li>
<input type="checkbox" name="state-checkselect" id="state-checkselect-AL" value="AL" />
<label for="state-checkselect-AL>Alabama<label>
</li>
[...]
<li>
<input type="checkbox" name="state-checkselect" id="state-checkselect-WY" value="WY" />
<label for="state-checkselect-WY>Wyoming<label>
</li>
</ul>
View the source of this page to see the relevant CSS for .checkselect
. There's not much to it.