I have a Json response. I need to take each value and append them to the Select tag. Each value separated by comma should be appended as a option in select tag.
Code is :
Jquery:
var dec ={"dc":["One","Two","Three"]};
jQuery.each(dec, function(index, value) {
$(".request").append("<option value='" + index + "'>" + value + "</option>");
});
HTML:
<select class="request">
</select>
The above code is appending everything to a single option but not as different options in select tag