Copy code code as follows:
<div>
<select name = "yyyy" onchange = "yyyymm (this.value)">>
<option value = ""> Please select year </option>
</select>
<select name = "mm" onChange = "mmdd (this.value)">
<option value = ""> Select Moon </option>
</select>
<select name = "" "
<option value = ""> Select Day </option>
</select>
</div>
<script language = "javascript">
function window.onload () {
Stryyyy = document.form1.yyyy.outerhtml;
strmm = document.form1.mm.outerhtml;
strdd = document.form1.dd.outerhtml;
Monhead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Let's give the content of the year of the year.
var y y = new date (). getfullyear ();
var str = Stryyyyy.substring (0, Stryyyyyyyyyy -Length -9);
for (var I = (y -30); i <(y+30); i ++) // This year's prevailing, the first 30 years, the next 30 years
{{
str + = "<option value = '" + I + "'>" + I + "year" + "</option>/r/n";
}
document.form1.yyyy.outerhtml = str + "</select>" ";
// The drop -down box of Fuyue
var str = strmm.substring (0, strmm.length -9);
for (var I = 1; i <13; i ++) {
str + = "<option value = '" + i + "'>" + i + "month" + "</option>/r/n";
}
document.form1.mm.outerhtml = str + "</select>" ";
document.form1.yyyy.value = y;
document.form1.mm.value = new date (). Getmonth () + 1;
var n = monhead [new date (). getmonth ()];
if (new date (). getmonth () == 1 && ispinyear (yyyyvalue) n ++;
writeday (n); // Date down drop box
document.form1.dd.value = new date (). Getdate ();
}
Function yyyymm (STR) // The date changes when the year changes (mainly judging the year of the Ping Ping)
{{
var mmvalue = document.form1.mm.option
if (mmvalue == "") {dd.outerhtml = strdd; return;}
var n = monhead [mmvalue - 1];
if (mmvalue == 2 && ispinyear (str)) n ++;
Writeday (n)
}
Function mmdd (STR) // Monthly changing date link
{{
varyyyvalue = document.form1.yyyy.options [document.form1.yyyy.selectEdex]. Value;
if (str == "") {dd.outerhtml = strdd; return;}
var n = monhead [str -1];
if (str == 2 && ispinyear (yyyyvalue) n ++;
Writeday (n)
}
Function WRITEDAY (n) // The drop -down box of the date of writing date
{{
var s = strdd.substring (0, strdd.length -9);
for (var I = 1; i <(n+1); i ++)
s + = "<option value = '" + I + "'>" + I + "" + "</option>/r/n";
document.form1.dd.outerhtml = s + "</select>" ";
}
Function iSpinyear (year) // Judging whether to flatten the year
{{
Return (0 == Year % 4 && (year % 100! = 0 || Year % 400 == 0))
}