function setday()
{
var themonth=document.getelementbyid("month");
var themaxmonthday=31;
if(themonth.value=="2")
{
themaxmonthday=28;
}
var theday=document.getelementbyid("day");
var tempdaylength=theday.options.length;
for(var j=tempdaylength;j>0;j--)
{
theday.options.remove(j);
}
for(var i=1;i<=themaxmonthday;i++)
{
var theoption=document.createelement("option");
theoption.innerhtml=i+"日";
theoption.value=i;
theday.appendchild(theoption);
}
}
1月
2月
3月
4月
5月
6月
12月
[ctrl+a 全选 注:如需引入外部js需刷新才能执行]