function order_UpItem() {
document.forms[1].changed.value=1;
UpItem(document.forms[1].idValues);
}
function UpItem(selectBox)
{
var j;
var sObj;
var len=selectBox.length-1;
for (j=0;j<=len;j++)
{ if (selectBox.options[j].selected)
{
if (j <= 0)
return;
sObj=document.createElement("option");
sObj.text = selectBox.options[j].text;// selectBox.options是什么意思
sObj.value = selectBox.options[j].value;//
if (sObj.value!="")
{
selectBox.options[j]=null;
selectBox.add(sObj,j-1);// selectBox.add什么意思
selectBox.options[j-1].selected=1;
j-=1;
}
}
}
}
2就是向select里动态添加option项目!