首页 > 解决方案 > 刷新引导选择时出错

问题描述

我使用 bootsrap-select

当我参考 Bootstrap-select 时出现此错误

错误是 :TypeError: this.$element.find(...)[0] is undefined

刷新时: $('.selectpicker').selectpicker('refresh');

感恩的

标签: jquerybootstrap-select

解决方案


我修复了这个错误

我们给标签一个 id 并使用该 id 来引用它。

<select id="selectid" class="selectpicker">
<option>1</option>
<option>2</option>
</select>

现在刷新

$('#selectid').selectpicker('refresh');


推荐阅读