我正在使用Bootstrap Multiselect dropdown
。我想在标签中显示所选文本。如果我取消选择该元素应从标签中删除。
当我选择此元素时,应显示在标签中,
到目前为止尝试过的代码:
$('#AttendeeLists').multiselect({
enableFiltering: true,
includeSelectAllOption: true });
答案 0 :(得分:0)
**the solution what I found to work in my case**
$('#multiselect1').multiselect({
selectAllValue: 'multiselect-all',
enableCaseInsensitiveFiltering: true,
enableFiltering: true,
maxHeight: '300',
buttonWidth: '235',
onChange: function(element, checked) {
var brands = $('#multiselect1 option:selected');
var selected = [];
$(brands).each(function(index, brand){
selected.push([$(this).val()]);
});
console.log(selected);
}
});