I'm using the jQuery library Image Picker https://rvera.github.io/image-picker/
Let's pretend I have the same setup like that:
<select class="image-picker" multiple="multiple">
<option data-img-src="http://placekitten.com/220/200" value="1">Cute Kitten 1</option>
<option data-img-src="http://placekitten.com/180/200" value="2">Cute Kitten 2</option>
<option data-img-src="http://placekitten.com/130/200" value="3">Cute Kitten 3</option>
<option data-img-src="http://placekitten.com/270/200" value="4">Cute Kitten 4</option>
</select>
I can select a single image programmatically like that
$(".image-picker").val("1");
$(".image-picker").data('picker').sync_picker_with_select();
In this case the first image would be selected. What if I ant to select the image with value 1 and 4? I have tried that:
$(".image-picker").val(["1","4"]);
$(".image-picker").data('picker').sync_picker_with_select();
but this doesn't work.
Any help would be much appreciated.