Hi Everyone,

I will make this example as simple as possible.

I have  2 divs, each containing list items. When an item in box #1 is
clicked, I want to move it to box #2. When that same item is clicked
in box #2, I want to move it to box #1.

My co-worker and I are working on this and here is some code he put
together:
http://pastie.caboo.se/137728

My original method was using something like this:

$(document).ready(function() {

  $('#suggestedCategories ul li a').click(function() {
  $('#selectedCategoriesList').append('<li><a href="#"
onclick="removeItem(this); return false;">' + $(this).html() +  '</a></
li>');
$(this.parentNode).remove();
});

});
 function removeItem(el) {
        $('#suggestedCategories ul').append('<li><a href="#">' + $(el).html()
+ '</a></li>');
        $(el.parentNode).remove();

 }

I want to know if there is a cleaner easier way to pull this off then
what was pasted at:
http://pastie.caboo.se/137728

Thanks,
Bryan

Reply via email to