http://silviomoreto.github.io/bootstrap-select/
<select id="basic2" class="show-tick form-control" multiple> <option>cow</option> <option>bull</option> <option class="get-class" disabled>ox</option> <optgroup label="test" data-subtext="another test"> <option>ASD</option> <option selected>Bla</option> <option>Ble</option> </optgroup> </select>
<script type="text/javascript"> $(document).ready(function(){ $("#basic2").selectpicker({ liveSearch: true, maxOptions: 1 }); }) </script>
Js设置选中
$('#Customer').selectpicker('val', '0');
$('#Customer').selectpicker('refresh');