I have a JSON array grabbed using the code below:
$.getJSON("somelist.php", function( json ) {
list = json;
});
somelist.php returns the following values:
[{"id":"1","name":"John Doe"},{"id":"2","name":"Jane Doe"}]
I also have a list box in the same page as shown:
<div id="someid" class="someclass">
<select id="someotherid" class="someotherclass">
</select>
</div>
How do I go about inserting the following options to someotherclass, between the select tags?
<option value="1">John Doe</option>
<option value="2">Jane Doe</option>
I have only done this using PHP before and it seems much more complicated to sort through using JS/jQuery.