且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

移动项目在双列表框

更新时间:2023-11-28 18:33:58

这code假设你有一个锚或点击它时,将触发迁徙:

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]);
    }

 }