I'm trying to change the currently selected option in a select with the Chosen plugin.
documentation包括更新列表,并在 Select 某个选项时触发事件,但没有(我看得见)外部更改当前选定的值.
I have made a jsFiddle to demonstrate the code and my attempted ways of changing the selection:
$('button').click(function() {
$('select').val(2);
$('select').chosen().val(2);
$('select').chosen().select(2);
});