$.fn.selectDate=function(){function e(e,t,n){for(var o=1;o<=e;o++){var a=document.createElement("option");$(a).attr("value",o),o<10&&(o="0"+o),$(a).html(o+t),$(n).append(a)}}function t(e){for(var t=$(e).find("option"),n=1;n<t.length;n++)e.removeChild(t[n])}for(var n=1900,o=(new Date).getFullYear(),a=document.getElementById("year"),l=document.getElementById("month"),c=document.getElementById("days"),r=o;r>=n;r--){var d=document.createElement("option");d.value=r,d.innerHTML=r+"年",a.appendChild(d)}$("#year").click(function(n){$("#year option:selected").val()&&(t(l),e(12,"月",l),t(c))}),$("#month").click(function(){t(c);var n=$("#year option:selected").val(),o=$("#month option:selected").val();1==o||3==o||5==o||7==o||8==o||10==o||12==o?e(31,"日",c):4==o||6==o||9==o||11==o?e(30,"日",c):2==o&&(n%4==0&&n%100!=0||n%400==0?e(29,"日",c):e(28,"日",c))})};