/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// 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>
Comments
