< script> function setDay(obj){ obj = obj.form; var years=parseInt(obj.years.options[obj.years.selectedIndex].value); var months= parseInt(obj.months.options[obj.months.selectedIndex].value); if(obj.years.selectedIndex==0 || obj.months.selectedIndex==0)return; var lastday = monthday(years,months); var itemnum = obj.days.length; if (lastday - 1 < obj.days.selectedIndex) { obj.days.selectedIndex = lastday - 1; } obj.days.length = lastday; for(cnt = itemnum 1;cnt <= lastday;cnt ) { obj.days.options[cnt - 1].text = cnt; } } function monthday(years,months) { var lastday = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); if (((years % 4 == 0) && (years % 100 != 0)) || (years % 400 == 0)) { lastday[1] = 29; } return lastday[months - 1]; } function forto(ff,to) { document. write(''); for(var ii=ff; ii<=to; ii ) document.write(''); } function a() { alert(document.all("years").value "Years " document.all("months").value "month" document.all("days").value "day") ; }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn