Simple (regular) usage
UPDATE
Now supporting keyboard navigation - it behaves almost like an ordinary HTML select element!
Turn your checkbox set into one single multi-select dropdown menu.
Turn boring list like this one...
...into THIS!
HTML
. . .
JavaScript
var myMultiSelect = new MultiSelect('.MultiSelect');
Append another checkbox set
Append another checkbox set to MultiSelect instance.
Usefull when you have content added dinamically (e.g. AJAX) or if you have (like in this example) multiple checkbox sets with different container classes/ids.
This example also takes options 'monitorText' argument to change text value of the monitor
Append another set
HTML
Append another set
JavaScript
var myCheckboxSet = new MultiSelect('.checkboxSet', { 'monitorText': ' item(s) checked' }); $('append').addEvent('click', function(e) { e.stop(); myCheckboxSet.append('.anotherCheckboxSet'); this.destroy(); });