Hopefully this will give you some direction on how it could be done..
click: function (event, ui) {
var lbl = ui.value;
if(ui.checked){
var ctrl = '<input type="checkbox" name="chk" checked="checked" class="chk" id="'+lbl+'">';
$("[id^=Main]:checked").each(function(){
$(this).nextAll('.holder:first').append('<div>'+ctrl+lbl+'</div>');
});
}
else {
$("[id^=Main]:checked").each(function(){
$(this).nextAll('.holder:first').find('div input[id='+lbl+']').parent().remove();
});
}
if (ui.checked && $(".multiselect").children(":checked").length >= 5) {
return false;
}
}
Example: