Skip to content

Instantly share code, notes, and snippets.

@cman81
cman81 / multiSelectToCheckboxes.js
Created June 16, 2016 08:50 — forked from jmcd/multiSelectToCheckboxes.js
jQuery plugin to convert multi-select HTML to checkbox list
(function($) {
var methods = {
init: function() {
var $ul = $("<ul/>").insertAfter(this);
var $container = $ul.prev().andSelf().wrapAll("<div class='multiselect-to-checkboxes'></div>");
var baseId = "_" + $(this).attr("id");
$(this).children("option").each(function(index) {
var $option = $(this);
var id = baseId + index;