我将 select2 与 bootstrap3 结合使用。
https://select2.github.io/examples.html
单选框
如何在搜索栏添加搜索图标?
像这样:
https://fk.github.io/select2-bootstrap-css/
这是我的 Select2 选项代码:
$(".select2").select2({
theme: 'bootstrap'
});
这是我的 HTML 代码:
<select style="width:100%" class="select2">
<optgroup label="Test-group">
<option>test1</option>
<option>test2</option>
</optgroup>
</select>
谢谢。
最佳答案
检查你的html并找到输入的css规则,然后为其添加背景,如下所示:
背景:#fff url('select2.png') no-repeat 100% -22px;
关于javascript - Select2 搜索字段上的搜索图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39323333/