上代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <dl> <dt>出生日期:</dt> <dd><select id="year"> <script> for(var i=1900;i<=2015;i++){ document.write("<option value="+i+">"+i+"</option>"); } </script> </select>年 <select id="month"> <script> for(var i=1;i<=12;i++){ document.write("<option value="+i+">"+i+"</option>"); } </script> </select>月 <select id="day"> <script> for(var i=1;i<=31;i++){ document.write("<option value="+i+">"+i+"</option>"); } </script> </select>日</dd> </dl> </body> </html>