1$(function(){
2 var dtToday = new Date();
3
4 var month = dtToday.getMonth() + 1;
5 var day = dtToday.getDate();
6 var year = dtToday.getFullYear();
7 if(month < 10)
8 month = '0' + month.toString();
9 if(day < 10)
10 day = '0' + day.toString();
11
12 var maxDate = year + '-' + month + '-' + day;
13 alert(maxDate);
14 $('#txtDate').attr('min', maxDate);
15});