if (window.form1.select1.selectedindex>=-1){ 
window.form1.select1.selectedIndex=window.form1.select1.selectedIndex-1}

解决方案 »

  1.   

    <form name=form1 action="1.asp">
    <input name=a type=button onclick="aa()">
    <select name="S" id="select1">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3" selected>3</option>
      </select>
      <input type=submit>
    </form>
    <script>
    function aa()
    {
    document.form1.elements["S"].options[1].selected=true}
    </script>
      

  2.   

    <body>
    <script>
    function previous()
    {
    var s1 = document.all("s1");
    if(s1.selectedIndex >= 1 )
    {
    s1.selectedIndex = s1.selectedIndex - 1;
    }
    }
    function next()
    {
    var s1 = document.all("s1");
    if(s1.selectedIndex < s1.options.length - 1 )
    {
    s1.selectedIndex = s1.selectedIndex + 1;
    }
    }
    </script>
    <select id=s1>
    <option>
    a
    </option>
    <option>
    b
    </option>
    <option>
    c
    </option>
    <input type=button value="previous" onclick="previous();">
    <input type=button value="nex" onclick="next();">
    </select>
    </body>