这都想出来了,只差一步了啦sel.option[n].selected = true ;别忘了给分哦,西西,今天真的赚到了~

解决方案 »

  1.   

    可是我的option[n]不是固定的。我可不可以在响应onchange前先得到select控件是selected的哪一个,然后在onchange里写楼上的哪句。
      

  2.   

    <HTML><SCRIPT LANGUAGE=javascript>
    function a(itselt)
    {
    if(confirm("ok?"))
    itself=1
    else
    document.FORMFAD.sel.options[0].selected=1}
    </SCRIPT>
    <form name=FORMFAD>
    <select name=sel  onchange="a(this.options[this.selectedIndex].selected)">
    <option>请选择
    <option>aaaaa
    <option>bbbbb
    <option>ccccc
    </select>
    </form>
    </HTML>