zoukankan      html  css  js  c++  java
  • select optionschange oeder


    <HTML>

    <HEAD>

    </HEAD>

    <script>

     function ck(objName,sourceIndex,targetIndex){

       var text1,text2,value1,value2;

       text1=objName.options[sourceIndex].text;

       value1=objName.options[sourceIndex].value;

       text2=objName.options[targetIndex].text;

       value2=objName.options[targetIndex].value;

       objName.options[sourceIndex]=newOption(text2,value2);

       objName.options[targetIndex]=newOption(text1,value1);

    }

    </script>

    <BODY>

    <formname=form1>

     <select name=sele multiple>

     <option value=1>1</option>

      <option value=2>2</option>

       <option value=3>3</option>

        <option value=4>4</option>

        </select>

        <buttononclick="ck(document.form1.sele,3,2);"> change order</button>

        </form>

    </BODY>

    </HTML>

  • 相关阅读:
    LeetCode 260
    LeetCode 258
    LeetCode 237
    LeetCode 226
    LeetCode 203
    LeetCode 202
    codeforces 7D
    codefroces 7C
    codeforces 7B
    codeforces 6E (非原创)
  • 原文地址:https://www.cnblogs.com/liaoshiyong/p/3150898.html
Copyright © 2011-2022 走看看