HTML
<script> function sortMe(x){ var tmpAry = new Array(); for (var i=0; i<5 ;i++) { tmpAry[i] = new Array(); if(x=='text' ){ tmpAry[i][0] = Sel[i].text; tmpAry[i][1] = Sel[i].value; } if(x=='value' ){ tmpAry[i][0] = Sel[i].value; tmpAry[i][1] = Sel[i].text; } } tmpAry = tmpAry.sort() ; for (var ii=0; ii<5 ;ii++) { if(x=='text' ){ Sel[ii].text = tmpAry[ii][0] ; Sel[ii].value = tmpAry[ii][1] ;} if(x=='value'){ Sel[ii].value = tmpAry[ii][0] ; Sel[ii].text = tmpAry[ii][1] ;} } } </script>
沒有留言:
張貼留言