How to copy

后端 未结 4 1982
忘掉有多难
忘掉有多难 2020-12-14 05:39

I am using the two sided multi select found here http://www.stevefenton.co.uk/cmsfiles/assets/File/twosidedmultiselect.html and need to add the selected options in the right

4条回答
  •  再見小時候
    2020-12-14 06:00

    
    
    
    
    
    
    
    
    

    jQuery:

    $('.add').on('click', function() {
        var options = $('select.multiselect1 option:selected').sort().clone();
        $('select.multiselect2').append(options);
    });
    $('.addAll').on('click', function() {
        var options = $('select.multiselect1 option').sort().clone();
        $('select.multiselect2').append(options);
    });
    $('.remove').on('click', function() {
        $('select.multiselect2 option:selected').remove();
    });
    $('.removeAll').on('click', function() {
        $('select.multiselect2').empty();
    });
    

    Sample Workout

提交回复
热议问题