showing results for - "how to set selected value in multiselect dropdown using jquery"
Arianna
13 Mar 2019
1I hope this will help you:
2
3Demo
4
5$(document).ready(function() {
6$("select").multiselect({
7   selectedText: "# of # selected"
8});
9var hidValue = $("#hidSelectedOptions").val();
10alert(hidValue);
11var selectedOptions = hidValue.split(",");
12for(var i in selectedOptions) {
13    var optionVal = selectedOptions[i];
14    $("select").find("option[value="+optionVal+"]").prop("selected", "selected");
15}
16$("select").multiselect('reload');
17});
18EDIT
19
20refresh has been removed from latest jQuery-MultiSelect. Using reload will solve the question now.
queries leading to this page
select all option in multiselect dropdown jqueryjquery set option multi selectedshow selected value in multiselect dropdown jqueryhow to set multi select dropdown value in jqueryhow to set value in multiselect dropdownget dropdown multiple selected value in jqueryset selected value of multiselect dropdown in jqueryset select2 multiselect set value jqueryhow to get the multiple selected value of dropdown in jqueryhow to select multiple value in dropdown using jqueryjquery multiselect dropdown dynamically add optionsjquery multiselect set selected valuesmulti value select box jqueryjquery multiselect change selected valuejquery multiselect dropdown give valuejquery select multiple option set selectedjquery set multiple select option valuehow to set selected value in multiselect dropdown using jqueryjquery set multi select option valueset selected values multiple select jquerymultiselect dropdown set value jquerychosen dropdown how to set multiple selected values in jqueryget multiple selected value of dropdown on dropdown change in jqueryjquery set multiple select option selected valuejquery selected multiselect option valuehow to set multiple select value in jqueryset selected value of multiselect dropdown in javascriptset item selected multiselect jqueryset selected multiselect selection in dropdown javascriptmultiselect dropdown set selected valuemultiple value select dropdown in jqueryset multi select selected values jqueryset multiselect value jqueryset selected multiple select jqueryhow to set selected value in multiselect dropdown using jquery examplejquery set multiple dropdown valuehow to on change select multiple drop down in jqueryjquery chosen multiselect set selected valuesset selected values in multiselect jqueryhow to change selected value of multiple dropdown fselect in jqueryselect 2 dropdown set value jqueryjquery multiselect dropdown with checkbox set selected valueschange multiple to single selection dropdown jquerymultiselect dropdown selected value jqueryhow to set select array values to multiselect dropdown using jqueryadd selected attribute to option jquery with multiselecthow to set selected value in multiselect dropdown using jquery