方法有两种。
第一种通过
< select id = "sel" >
< option value = "1" >1 option >
< option value = "2" selected = "selected" >2 option >
< option value = "3" >3 option >
select >
第二种为通过前端js来控制选中的项:
< script type = "text/javascript" >
function change(){
document.getElementById("sel")[2].selected=true;
}
script >
< select id = "sel" >
< option value = "1" >1 option >
< option value = "2" >2 option >
< option value = "3" >3 option >
select >
< input type = "button" value = "修改" onclick = "change()" />
获取
var val = document.all.Item.options[document.all.Item.selectedIndex].text;
var i=document.getElementById('sel').options[document.getElementById('sel').selectedIndex].value;