前端HTML:javascript
<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:css
<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>
使用效果圖:前端
獲取值, java
$(‘#usertype’).val()便可