function moveSelected(selectSrc, selectDest) {
for (var i = selectSrc.childNodes.length-1; i>=0; i--) {
var option = selectSrc.childNodes;
if (option.selected == true) {
selectSrc.removeChild(option);
option.selected = false;
selectDest.appendChild(option);
}
}
}
function moveSelected(selectSrc, selectDest) {
for (var i = 0; i<selectSrc.childNodes.length; i++) {//这一行和上面的差异
var option = selectSrc.childNodes;
if (option.selected == true) {
selectSrc.removeChild(option);
option.selected = false;
selectDest.appendChild(option);
}
}
} |