I am trying to deselect all values of options which allow multiple selection by using this code for chosen plugin
var lstViewCities= $('#lstViewCities');
$(lstViewCities).find("option").each(function(item) {
$(item).attr('selected', '');
});
$(lstViewCities).trigger("liszt:updated");
but nothing is happening and same for selecting all option
var lstViewCities= $('#lstViewCities');
$(lstViewCities).find("option").each(function(item) {
$(item).attr('selected', 'selected');
});
$(lstViewCities).trigger("liszt:updated");
[edit]
here is live example for above problem
[/edit]
Doesn't it support selecting multiple options using code or what? Your answers will be surely of great help, looking forward to your responses. Thanks :)