html代码


测试版日历表






查询日历表














js代码
function $(id){
return document.getElementById(id);
}
function loadYear(){
var r=toArrayL(0);
var y=$("yearNumber");
for(var i=0;i roundAll(r,"yearNumber",i);
}
}

function showDay(){
$("dateNumber").options.length=0;
var r=toArrayL(1);
var month=$("monthNumber").value;
if(month=="--请选择--"){
var obj=document.createElement("option")
obj.innerHTML="--请选择--";
$("dateNumber").appendChild(obj);
}
var big=["1","3","5","7","8","10","12"];
for(var k=0;k if(month==big[k]){
for(var i=0;i roundAll(r,"dateNumber",i);
}
}
}
if(month=="2"){
var a=parseInt($("yearNumber").value);
var b=((a%4==0&&a%100!=0)||a%400==0)
if(b==true){
var r1=toArrayL(2);
for(var i=0;i roundAll(r1,"dateNumber",i);
}
}else{
var r2=toArrayL(3);
for(var i=0;i roundAll(r2,"dateNumber",i);
}
}
}
var date2=["4","6","9","11"]
for(var k=0;k if(month==date2[k]){
var r3=toArrayL(4);
for(var i=0;i roundAll(r3,"dateNumber",i);
}
}
}
}
var arrayList1=[
["1950","2020"],
["1","31"],
["1","29"],
["1","28"],
["1","30"]
];
function toArrayL(toObj){
var r=arrayList1[toObj];
var array=new Array();
array[0]=["--请选择--"];
var k=1;
for(var i=r[0];i<=r[1];i++){
array[k]=i;
k++;
}
return array;
}
function roundAll(rObj,idObj,iobj){
var obj=document.createElement("option")
obj.innerHTML=rObj[iobj];
$(idObj).appendChild(obj);
}