if(nIndex<0) for(var j=1;j<=nIndex;j++) if(nIndex<0) sel.options[nLen-1].value = sValue;
...{
alert("请选择一个要移动的已选按钮!");
return;
}
var tempValue = document.getElementById("tempValue");//用于临时存放option的值
tempValue.value = "";
for(var k=0;k
tempValue.value += sel.options[k].value+";";
}
var arrValue = tempValue.value.split(';');
var sValue=sel.options[nIndex].value;
var sHTML=sel.options[nIndex].innerHTML;
sel.options[0].value = sValue;
sel.options[0].innerHTML = sHTML;
...{
sel.options[j].value = arrValue[j-1];
sel.options[j].innerHTML = arrValue[j-1];
}
sel.selectedIndex = 0;
}
//移动到最后
function DownLast()
...{
var sel=document.getElementById("selectCheck");
var nIndex = sel.selectedIndex;
var nLen = sel.options.length;
if ((nLen<1)||(nIndex==nLen)) return;
...{
alert("请选择一个要移动的已选按钮!");
return;
}
var tempValue = document.getElementById("tempValue");//用于临时存放option的值
tempValue.value = "";
for(var k=nIndex+1;k
tempValue.value += sel.options[k].text+";";
}
var arrValue = tempValue.value.split(';');
var sValue=sel.options[nIndex].value;
var sHTML=sel.options[nIndex].innerHTML;
for(var j=nIndex;j
sel.options[j].value = arrValue[j-nIndex ];
sel.options[j].innerHTML = arrValue[j-nIndex];
}
sel.options[nLen-1].innerHTML = sHTML;
sel.selectedIndex = nLen-1;
}