I'm trying to create a dropdown using javascript/jquery. Here is the code I'm using:
var trucks = response.trucks; //response from ajax request, value is 4 truck objects
var rt = $("#route_"+response.route_id);
rt.append("<select class=\"email_route_dd\" name=\"timeslot\">")
for(var ii = 0; ii <trucks.length; ii++){
var t = trucks[ii]; //truck object
if(ii+1 == trucks.length){
console.log("Last");
rt.append("<option name=\"\" class=\"driver\" value=\""+t.truck_id+"\" email=\""+t.driver_email+"\">"+t.driver+"</option>");
}else{
rt.append("<option name=\"\" class=\"driver\" value=\""+t.truck_id+"\" email=\""+t.driver_email+"\">"+t.driver+"</option>");
}
};
rt.append("</select>");
This code is outputing the following code:

The above image is what I get when I inspect the element with Chrome.
The output is not displaying the dropdown content after the request. The dropbox is there, but none of the content is in it.