jQuery динамически выбранные параметры не отображаются в jquery .chosen.min. js - PullRequest
0 голосов
/ 23 января 2020

Я использую плагин Chosen .

var terms_types = [2,3];

jQuery("#vendorterm option").each(function() {
    if(jQuery.inArray(jQuery(this).val(), terms_types) != -1) {
        console.log(jQuery(this).val());
        jQuery(this).attr("selected", "selected");
        jQuery('#vendorterm').trigger('chosen:updated');
    } 
 });

Новые многократно выбранные параметры не выбираются.

...