帮忙看看,怎么改正确。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function toDate1(){
with(document.all){
vYear=parseInt(year.options[year.selectedIndex].text)
alert(year.selectedIndex);
vMonth=parseInt(month.options[month.selectedIndex].text)
day.length=0;
for(i=0;i<(new Date(vYear,vMonth,0)).getDate();i++){
day.options[day.length++].value=day.length;
day.options[day.length-1].text=day.length;
}
}
}
window.onload=toDate;
</script>
</head>
<body>
<form>
<select id=year onchange=toDate()>
<script>for(i=1970;i<=2010;i++)document.write("<option>"+i+"</option>")</script>
</select>
<select id=month onchange=toDate()>
<script>for(i=1;i<=12;i++)document.write("<option>"+i+"</option>")</script>
</select>
<select id=day></select></form>
</body>
</html>