1.主页面 引入JS Jquery bootstrap 包
无标题文档
2.JS包
// JavaScript Document$(document).ready(function(e) { $("#nian").change(function(){ LoadTian(); }) $("#yue").change(function(){ LoadTian(); })});//加载年份function LoadNian(){ var date=new Date; var year=date.getFullYear(); var str = ""; for(var i=year-5;i"+i+""; } else { str +=" "; } } $("#nian").html(str); }//加载月份function LoadYue(){ var date=new Date; var yue=date.getMonth()+1; var str = ""; for(var i=1;i<13;i++) { if(i==yue) { str +=" "; } else { str +=" "; } } $("#yue").html(str);}//加载天function LoadTian(){ var date=new Date; var tian = date.getDate(); var zs = 31; //总天数 var nian = $("#nian").val(); var yue = $("#yue").val(); if(yue == 4 || yue==6 || yue==9 || yue==11) { zs = 30; } else if(yue==2) { if((nian%4==0 && nian%100 !=0) || nian%400==0) { zs = 29; } else { zs = 28; } } var str = ""; for(var i=1;i "+i+""; } else { str +=" "; } } $("#tian").html(str); }