<body>
年<input type="text" id="a">
月<select id="b">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
日<select id="c">
</select>
</body>
</html>
<script>
a=document.getElementById("a");
b=document.getElementById("b");
c=document.getElementById("c");
a.onblur=function(){
aa=a.value;
}
cc=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
b.onblur=function(){
if(b.value==2&&((aa%4==0&&aa%100!=0)||aa%400==0)){
for(x=0;x<28;x++){
e=document.createElement("option")
e.innerHTML=cc[x];
c.appendChild(e);
}
}
else if(b.value==2&&((aa%4!=0&&aa%100==0)||aa%400!=0)){
for(x=0;x<29;x++){
e=document.createElement("option")
e.innerHTML=cc[x];
c.appendChild(e);
}
}
else if(b.value==1||b.value==3||b.value==5||b.value==7||b.value==8||b.value==10||b.value==12){
for(x=0;x<31;x++){
e=document.createElement("option")
e.innerHTML=cc[x];
c.appendChild(e);
}
}
else if(b.value==4||b.value==6||b.value==9||b.value==11)
for(x=0;x<30;x++){
e=document.createElement("option")
e.innerHTML=cc[x];
c.appendChild(e);
}
}