$(function(){ var dtToday = new Date(); var month = dtToday.getMonth() + 1; var day = dtToday.getDate(); var year = dtToday.getFullYear(); $('#txtDate').attr('min', maxDate); });