Quote:
html += '<option value='+data[i].courseid+' "option:selected" >'+data[i].course+'</option>';
Your generated HTML is invalid - you are adding the invalid attribute
"option:selected"
to your option element. The attribute is simply called
selected
, and should not be wrapped in quotes:
html += '<option value='+data[i].courseid+' selected>'+data[i].course+'</option>';