$(".selectpicker").selectpicker({
title:"默认值"
})
基本用法
用 .selectpicker class 创建<select>
<select class="selectpicker">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
启用 Bootstrap-Select via JavaScript:
$('.selectpicker').selectpicker()
设置:
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
})
<!DOCTYPE html><html><head> <title>jQuery bootstrap-select可搜索多选下拉列表插件</title> <script src="../js/jquery-1.11.3.js"></script> <script type="text/javascript" src="../js/bootstrap-select.js"></script> <link rel="stylesheet" type="text/css" href="../css/bootstrap-select.css"/> <link href="../css/dist/css/bootstrap.css" rel="stylesheet"/> <script src="../css/dist/js/bootstrap.js"></script> <script type="text/javascript"> $(document).ready(function () {$('.selectpicker').selectpicker({'selectedText': 'cat',header: 'Select a condiment','noneSelectedText': '请选择','deselectAllText': '全不选','selectAllText': '全选'}) }) </script></head><body><select class="selectpicker" multiple data-live-search="true" data-actions-box="true"> <option>name</option> <option>addr</option> <option>email</option> <option selected>phone</option> <option>tel</option></select></body></html>欢迎分享,转载请注明来源:内存溢出
评论列表(0条)