I\'m using two dropdown(month, year). I\'ve to restrict future month based on year. suppose if I choose \'2014\', it should show the months till January.I don\'t have any clue h
$('#year').on('change',function() {
var option=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec"];
var currMon= (new Date).getMonth();
var currYear = (new Date).getFullYear();
$('#month').html('');
if(currYear == $('#year :selected').text()&& currMon==0){
for(i=0; i<=currMon; i++)
{
$('#month').append($("").val(option[i]).text(option[i]));
}
}else
{
for(i=0; i<=11; i++)
{
$('#month').append($("").val(option[i]).text(option[i]));
}
}
});