Can't move li elements from one unorderted list to another
Posted
by
Roland
on Stack Overflow
See other posts from Stack Overflow
or by Roland
Published on 2011-01-15T22:44:56Z
Indexed on
2011/01/15
22:53 UTC
Read the original article
Hit count: 199
jQuery
I have two un-ordered list
<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 the id add is pressed all elements from #list1 should be move to #list2. How do I move elements from one list to another using JQuery
I though of something like the below, but not sure how to do the actual moving
$("#add").click(function(){
$("#list1 li").each(function(){
//Do not know what to put in here
}
})
© Stack Overflow or respective owner