1<input name="month" list="months" >
2<datalist id="months" >
3</datalist>
4
5<script language="javascript">
6var str=''; // variable to store the options
7var month = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
8for (var i=0; i < month.length;++i){
9str += '<option value="'+month[i]+'" />'; // Storing options in variable
10}
11var my_list=document.getElementById("months");
12my_list.innerHTML = str;
13</script>
14
1<input name="month" list="months" >
2<datalist id="months" >
3</datalist>
1var str=''; // variable to store the options
2var month = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
3for (var i=0; i < month.length;++i){
4str += '<option value="'+month[i]+'" />'; // Storing options in variable
5}
1var my_list=document.getElementById("months");
2alert(my_list.options.length);
1var my_list=document.getElementById("months");
2my_list.innerHTML = str;