jquery - 刷新引导选择时出错
问题描述
我使用 bootsrap-select
当我参考 Bootstrap-select 时出现此错误
错误是 :TypeError: this.$element.find(...)[0] is undefined
刷新时: $('.selectpicker').selectpicker('refresh');
感恩的
解决方案
我修复了这个错误
我们给标签一个 id 并使用该 id 来引用它。
<select id="selectid" class="selectpicker">
<option>1</option>
<option>2</option>
</select>
现在刷新
$('#selectid').selectpicker('refresh');
推荐阅读
- reactjs - 如何在反应js中另一个下拉值的onchange上动态添加下拉值?
- share - Linkedin 分享网页不显示摘要
- powershell - 为什么我的带有多个 -AND 条件的 If 语句不能正常运行?
- c# - UWP 桌面桥应用程序在双击时崩溃
- sql - Group BY 语句错误以获取唯一记录
- docker - 运行 DockerFile 时找不到文件异常
- c# - C#如何用另一个点击事件终止一个点击事件处理程序
- android - 传入的语音未在 Android 中录制
- javascript - 分页没有在页面刷新时初始化,整个页面光滑库中的多个滑块
- sql - Select data where condition matches and if none, then select all?