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>

posted @ 2013-06-12 11:40  廖世勇  阅读(152)  评论(0编辑  收藏  举报