'添加option到指定位置(按value排序) dim valindex valindex=-1 for i=0 to selcom.length-1 if selcom.Options(i).value >selallcomoption.value then valindex=i exit for end if next dim oOption set oOption= document.CreateElement("OPTION") oOption.text = selallcomoption.text oOption.value =selallcomoption.value selcom.add(oOption) if valindex <> -1 then for i = selcom.length-1 to valindex+1 step -1 selcom.Options(i).text=selcom.Options(i-1).text selcom.Options(i).value=selcom.Options(i-1).value next selcom.Options(valindex).text=selallcomoption.text selcom.Options(valindex).value=selallcomoption.value end if