Return to Snippet

Revision: 51583
at September 28, 2011 18:34 by Sullan


Initial Code
// jQuery
$('.add').click(function(){
    $('.keep option:selected').clone().appendTo('.delete').end().end().remove();
});
$('.rem').click(function(){
    $('.delete option:selected').clone().appendTo('.keep').end().end().remove();
});

// HTML
<select class='keep'>
    <option value='Keep this' selected>Keep This</option>
    <option value='Delete this'>Delete This</option>
</select>
<span class='add'>+Add</span>
<select class='delete'>
</select>
<span class='rem'>-Rem</span>

Initial URL

                                

Initial Description

                                

Initial Title
Move from one list to another list and vice-versa

Initial Tags

                                

Initial Language
jQuery