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
Here's the one liner. Assuming you are saying January=1, February=2 etc..(being normal) Here's the leap year example:
var y = 2012; var m = 2; var daysInMonth = new Date(y,m,1,-1).getDate();