//添加事件y.addEventListener('change', function() { year = this.value month = month dayInWeek = new Date(year, month, 1).getDay() printDay() }) m.addEventListener('change', function() { year = year month = this.value dayInWeek = new Date(year, month, 1).getDay() printDay() })
y事件能够触发并且执行,m触发之后整个日历就变空白了,如下图:
互换的青春
相关分类