I am trying to populate a select html element with data from a list of JSON results. Here is the code I have attempted:
JSON output: jquery loop on Json data using $.each
{"Eua":"Eua","Ha'apai":"Ha'apai","Niuas":"Niuas","Tongatapu":"Tongatapu","Vava'u":"Vava'u"}
success: function(result){
console.log(data);
var data = jQuery.parseJSON(result);
jQuery.each(data,function(key, value)
{ //jQuery("#state").html();
console.log(key);
jQuery("#state").html('<option>'+value+'</option>');
})