I need to create option tags inside a select tag using JQuery,
this is the select tag:
<select id="tickets-room" style="height: 20px; width:200px; display: inline-block; margin-top:30px;" onchange="refreshRooms(this.value);">
</select>
Each option tag need an ID like 1,2,3,4
Each option tag should recieve "resp[].key" as it text.
I don't know if it makes sense, but i don't know how to explain it very well, this is the code i have with some of the elements i need. resp.key is the name i need as a text inside option tags, resp.value is an url i need to place on a button outside the select tag.
function refreshRooms(city){
$.ajax('/services/tickets/<%= movieId %>?city=' + city).done(
function(resp){
alert(resp.length);
console.log(resp[0].key + " " + resp[0].value);
}
);
}