I have a list of select boxes with incremental numbers to identify then e.g.
<select id="my-select-0">
<option value="1">first option</option>
<option value="2">first option</option>
< option value="3">first option</option>
</select>
<select id="my-select-1">
<option value="1">first option</option>
<option value="2">first option</option>
<option value="3">first option</option>
</select>
<select id="my-select-2">
<option value="1">first option</option>
<option value="2">first option</option>
<option value="3">first option</option>
</select>
I have a json string which I want to use to pre populate these selects e.g.
json = "[{'my-select': 1},
{'my-select': 3}]";
in the example above my-select-0 would be set to 1 and my-select-1 is set to 3.
How would I go about doing this in JQuery?
Thanks