日期:2014-05-16 浏览次数:20544 次
<select id='year'></select> <script type='text/javascript'> function init() { var endyear = new Date().getFullYear(); var startyear = endyear - 2; for(var i = startyear ; i <= endyear ; i ++) { var opt = document.createElement('option'); opt.innerHTML = opt.value = i; document.getElementById('year').appendChild(opt); } } init(); </script>