<script language="javascript">
//根据option的value值修改select的默认选项
function selectValues(obj,v){
if(obj!=null && v!=null){
for (var i = 0; i < obj.options.length; i++) {
if (obj.options(i).value==v) {
obj.selectedIndex=i; break;
}
}
}
}
function fun1(){
var val = document.getElementById("Tyear").value;
var obj = document.getElementById("year");
selectValues(obj,val);
}
</script>
<input type="text" value="2020" id="Tyear"/><input type="button" οnclick="fun1()" value="确定"/>
<br />
<select id="year" name="year" >
<option value="2013" >2013</option>
<option value="2014" selected="selected">2014</option>
<option value="2015" >2015</option>
<option value="2016" >2016</option>
<option value="2017" >2017</option>
<option value="2018" >2018</option>
<option value="2019" >2019</option>
<option value="2020" >2020</option>
</select>