发一个在前辈基础上修改的下拉时间代码(2个选择时间,到小时),好的话给顶一下
<html>
<head>
<script language= "JavaScript ">
function initDate() {
var obj=document.all[ 'dateform '];
var y=obj.year;
var m=obj.month;
var d=obj.date;
var h=obj.hour;
var y1=obj.year1;
var m1=obj.month1;
var d1=obj.date1;
var h1=obj.hour1;
var indexDate = new Date();
for (var i=2005;i <2050;i++) {
y.options.length=y.options.length+1;
y.options[y.options.length-1].text=y[y.options.length-1].value=i;
}
for (var i=2005;i <2050;i++) {
y1.options.length=y1.options.length+1;
y1.options[y1.options.length-1].text=y1[y1.options.length-1].value=i;
}
y.value=2007;
for (var i=0;i <12;i++) {
m.options.length=i+1;
m[i].value=i+1;
m.options[i].text=i+1;
}
m.value=1;
for (var i=0;i <12;i++) {
m1.options.length=i+1;
m1[i].value=i+1;
m1.options[i].text=i+1;
}
for (var i=0;i <31;i++) {
d.options.length=i+1;
d[i].value=i+1;
d.options[i].text=i+1;
}
d.value=1;
y1.value = indexDate.getYear();
m1.value = indexDate.getMonth() + 1;
var arrd = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if (y1.value % 4 == 0)