我可以通过做一些类似的事情来改变原始选择的选择选项-
$('#mySelectList option:first').prop('selected', true)
但这不会更新选择的 selectric 显示。
最佳答案
根据 this pull request ,您可以“刷新”插件:
$('#mySelectList').prop('selectedIndex', 0).selectric('refresh');
来自文档:
$('select').selectric('refresh'); // Reconstruct the instance of plugin
关于javascript - 如何使用 javascript 更改 jquery selectric 元素的选定选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24437866/