For the life of me, I have no idea why this isn't working - I've tried multiple ways of trying to insert the JSON data into the <option> code each time it doesn't work like that - it merely outputs the HTML text and not inside a <select> drop down
$.getJSON( "group.asp", function( data ) {
$('#msgBox').html($('#msgBox').html() + '<div class="table-row"><div class="table-col-l">Name:</div><div class="table-col-r"><select id="name1"><option>SELECT</option>')
$(data).each(function(index, element) {
console.log(element)
$('#msgBox').html($('#msgBox').html() + '<option>'+element.name+'</option>');
});
$('#msgBox').html($('#msgBox').html() + '</select></div></div>')
})
I've tried creating it as a separate variable that is inserted after the .each function but that didn't work either.