Moving items in Dual Listboxes

asp.net, javascript, listbox, listbox-control

Solution

This code assumes that you have an anchor or that will trigger to movement when it is clicked:

document.getElementById('moveTrigger').onclick = function() {

    var listTwo = document.getElementById('secondList');
    var options = document.getElementById('firstList').getElementsByTagName('option');

    while(options.length != 0) {
        listTwo.appendChild(options[0]);
    }

 }

Problem

How can I move items from one list box control to another listbox control using JavaScript in ASP.NET?

Original source