I'm adding the HTML elements in runtime by AJAX call from Javascript file.
I want to use combo-box drop down element to show the list of datas. To acheive this, I'm trying like below in my script file.
$("#myList").append("<select id=\"mlist\" >");
for(var i=0;i<datas.length;i++){
$("#myList").append("<option>"+datas[i]+"</option>");
}
$("#myList").append("</select>");
But in the browser, it shows the elements generated as
<select id="mlist"> </select>
<option>INDIA</option>
<option>CHINA</option>
<option>JAPAN</option>
I want the options to be inserted in between to the select element. Anyone kindly suggest me where I'm doing wrong?