I am using a chosen plugin for my multi-select list. Here I want to select various options by default. I tried to follow some responses from this thread, and ended up using:
$("#laptop_product").val("Macbook 12").trigger('change');
$('#laptop_product').trigger('chosen:updated');
where laptop_product
is the id of the select element:
<select name="products" multiple class="standardSelect" id="laptop_product" onchange="tableRefresh()" tabindex="5">
and Macbook 12
is one of the values in the dropdown list. However, this is not working and the options don’t appear on the website.