Cannot move li items from one unrelated list to another
I have two unordered lists
<ul id="#list1"> <li>one</li> <li>two</li> </ul> <ul id="#list2"></ul> and two buttons
<input id="add" name="yt1" type="button" value="<<" /><br /> <input id="remove" name="yt2" type="button" value=">>" /> If the button with id is pressed, all elements from # list1 should be moved to # list2. How to move items from one list to another using jQuery
I'm at least something like below, but not sure how to make the actual move
$("#add").click(function(){ $("#list1 li").each(function(){ //Do not know what to put in here } }) +4
4 answers