use this
<html><head> <title></title> <script> onload= function() { var mth = new Array(); mth[0] = "January"; mth[1] = "February"; mth[2] = "March"; mth[3] = "April"; mth[4] = "May"; mth[5] = "June"; mth[6] = "July"; mth[7] = "August"; mth[8] = "Septemeber"; mth[9] = "October"; mth[10] = "November"; mth[11] = "December"; var days = 31; var i = 0; var bmth = document.getElementById('bmth'); var bday = document.getElementById('bday'); for(i=0;i<mth.length;i++) { bmth.options[bmth.options.length] = new Option(mth[i],i); } for(i=0;i<days;i++) { bday.options[bday.options.length] = new Option(i+1,i+1 ); } } </script></head><body> <select id="bmth"></select> <select id="bday"></select></body></html>