How would I go about removing an object say from an unordered list and add it to another list while keeping its location? I know i can set the original item to hide() but then that leaves a small space where the item use to appear. Say i have a list A and B, if a user clicks on an item in A it needs to be added to B and removed from A. If they now click on a button to remove it from B and back to A, i want to have it displayed in the same spot it originally did. I know i can add it via append() but that won’t put it in the same location. Thoughts anyone?
Share
You could use .clone? so:
the jquery:
Obviously you can swap this round to add it to the first list, but to get the position you could use a number of ways, I would probably do:
and use “i” to get the position. you can append after a given object to so: