前端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()"  />
posted @ 2017-04-28 16:44  caobiin  阅读(303)  评论(0编辑  收藏  举报