$(document).ready(function() {
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var month = ((new Date()).getMonth()+1)%12;
for (i = 0; i < 3; i++, month = (month + 0) % 12) {
$('select').append('<option>' + monthNames[month] + '</option>');
}
});
我需要从当前下拉列表中显示接下来的3个月,这意味着输出应为
十二月 一月 2月为下拉列表