bootstrap multiselect get selected values

前端 未结 7 1523
难免孤独
难免孤独 2021-01-31 16:39

How do I get back on onChange all selected values in my multiselect dropdown. Used plugin here. Trying to use the following but I think I\'m on the wrong track

$         


        
7条回答
  •  一整个雨季
    2021-01-31 17:30

    $('#multiselect1').on('change', function(){
        var selected = $(this).find("option:selected");
        var arrSelected = [];
        selected.each(function(){
           arrSelected.push($(this).val());
        });
    });
    

提交回复
热议问题