I am having a multiselect dropdown as below
<select id="data" name="data" class="data" multiple="multiple">
<option value="100">foo</option>
<option value="101">bar</option>
<option value="102">bat</option>
<option value="103">baz</option>
</select>
On load of page, i will get an array of value like [101,102]. I should iterate through the array and make the values selected(check boxes corresponding to the ids should be checked). Please help.
that code should help:
from a php array into the multiselect...
// then in the JS script
I got a better solution from jquery-multiselect documentation.
The official site has mentioned (in "Manually check or uncheck a checkbox?" section) just to use click()
e.g.
OR by HTML