http://www.sayee.com/cloudchen/js/MoveSwapOptions.htm

解决方案 »

  1.   

    根据楼上提供的资料,作了一下修改:
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    <script>
    function SwapOptions(obj,direction)
    {
      var objIndex = obj.selectedIndex;
      var swapIndex=direction=="up"?objIndex-1:objIndex+1;
      if ((swapIndex==obj.length&&direction=="down")||(swapIndex==-1&&direction=="up")||swapIndex<0) return false;
      obj.options[objIndex].swapNode(obj.options[swapIndex]);
    }
    </script>
    </head><body><p><select size="7" name="D1" id="D1">
      <option selected>一</option>
      <option>二</option>
      <option>三</option>
      <option>四</option>
      <option>五</option>
    </select><input type="button" value="上" name="B1" onclick="SwapOptions(document.all.D1,'up')"><input type="button" value="下" name="B1" onclick="SwapOptions(document.all.D1,'down')"></p>
    </body></html>