var ind = from.selectedIndex; while (from.firstChild) to.appendChild(from.firstChild); to.selectedIndex = ind;