select框多选(利用Bootstrap-select)

前端HTML:

 <select  id="usertype" multiple class="selectpicker" style="width:150px;height: 38px;" >
    <option value="101" >打印条形码</option>
    <option value="104" >质检审核</option>
    <option value="105" >质检主管驳回</option>
    <option value="106" >维修质检</option>
            
 </select>

JS:

<script src="__PATH__/Storage/pageAllSn.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/css/bootstrap-select.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/js/bootstrap-select.min.js"></script>

<!-- (Optional) Latest compiled and minified JavaScript translation files -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/js/i18n/defaults-*.min.js"></script>
<script>
    $(window).on('load', function () {
    $('#usertype').selectpicker({
        'selectedText': 'cat'
    });
});
</script>

使用效果图:

获取值, 

$(‘#usertype’).val()即可 

  

posted @ 2018-11-07 17:19  tatasix  阅读(12184)  评论(0编辑  收藏  举报