是不是超出select的条目的范围了

解决方案 »

  1.   

    没有超出范围,我的完整的代码是:var selectIndex=routine.address.options.selectedIndex;
       if (selectIndex==0)
    {
      alert("已经到最上面了!");
    }
    else
    {
          selected=routine.address.options[selectIndex].text;
          up=routine.address.options[selectIndex-1].text;
          routine.address.options[selectIndex].text=up;
      routine.address.options[selectIndex-1].text=selected;
    }
      

  2.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head><body bgcolor=eeeeee>
    <table>
    <tr > 
    <td> 
    <select name=CSSelect size=6  > 
    <option value="11" selected >test11</option> 
    <option value="12">test12</option> 
    <option value="13">test13</option> 
    <option value="14">test14</option> 
    <option value="15">test15</option> 
    </select>
    </td> 
    <td>
    <input type=button value="↑"  name=ToUpButton onclick="moveUp()" ><br><br>
    <input type=button value="↓"  name=ToDownButton onclick="moveDown()" >
    </td>
    </tr> 
    </table>
    </body>  
      
    <script language=javascript>  
    function moveUp()  
    {  
    var i=document.all.CSSelect.selectedIndex;
    document.all.CSSelect.options[i].swapNode(document.all.CSSelect.options[(i==0)?(document.all.CSSelect.length-1):i-1]);
    }  
      
    function moveDown()  

    var i=document.all.CSSelect.selectedIndex;
    document.all.CSSelect.options[i].swapNode(document.all.CSSelect.options[(i<document.all.CSSelect.length-1)?(i+1):0]);
    }  
     
    </script>
      

  3.   

    不好意思我测试的是JK_10000(JK)的
    同意JK_10000(JK)