I have a HTML page with 3 dropdowns for the month, day and year and I was wondering if there was a way to populate the month drop down properly depending on the month and ye
Date.prototype.daysinMonth: function(){
var d= new Date(this.getFullYear(), this.getMonth()+1, 0);
return d.getDate();
}
function daysinMonthfromInput(month,year){
return (new Date(year,month-1,1)).daysinMonth();
}
alert(daysinMonthfromInput(2,2011));