<select id="select_year"></select> <script> $(document).ready(function(){ var head="<option value=‘‘ selected>全部</option>"; var year=""; var i=0; for(i=2005;i<=2030;i++){ year+="<option value=‘"+i+"‘>"+i+"</option>"; } var total = head+year; $(‘#select_year‘).append(total); }); </script>
时间: 2024-11-08 22:48:04