年份选择器


	
	
function setYear(){
			var yearObj = document.getElementById("year");
			yearObj.options.length = 0;
			yearObj.options[0] = new Option("","");
			for(var i=1;i<=50;i++){
				if(i>10){
					yearObj.options[i-10] = new Option("20"+(i)+resources.chooserSetting_year,"20"+i);//年
				}
			}
			//设置年份 
			var yearTime='';
			oldYear=yearTime;
			$("#year option[value='"+yearTime+"']").attr("selected","selected");
		}

你可能感兴趣的:(Jquery,HTML)