【发布时间】:2016-06-13 03:08:12
【问题描述】:
In the fiddle attached, I have two options pre-filled "Denmark" and "France", when the chosen select loads.如果我在选择框中选择更多值并单击清除按钮,我想使用相同的预填充值“丹麦”和“法国”恢复选择的选择。
我想更改此代码以预填充选定的值。
$("#Clear").click(function () {
$('.chosen-select option').prop('selected', false).trigger('chosen:updated');
});
更新: 如果有一种方法可以让预先填写哪些选项无关紧要,但如果有的话,应该恢复它们。
【问题讨论】:
标签: jquery jquery-chosen