Answer the question
In order to leave comments, you need to log in
How to output json in Select options?
I am making an ajax request. Passing an array with php "echo json_encode($data);" in js. How can I take the data from this array and output it to options?
I do so
success: function (data) {
$.each(data, function(key, val){
$('.select-secession').append('<option value="' + val + '">' + val + '</option>');
});
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question