1Use a string to store your option, and then append it to the select tag. Then, please check that data is there in the val.
2
3$.getJSON("get-data.php?dat=driver",function(data){
4 var stringToAppend = "";
5 $.each(data,function(key,val) {
6
7 stringToAppend += "<option value='" + val.id + "'>" + val.id + "</option>";
8
9 });
10
11 $("#night_Shift_text").html(stringToAppend);
12});