JQuery - A Practical Guide. Duplicate the <li> and put it at the end of the <ul>
I have the usual ul li. I want to bind li to a list that is based on whether it is first on the list.
HTML
<div id="gallery"> <ul> <li>Point Nr 1<p>lol</p></li> <li>Point Nr 2</li> <li>Point Nr 3</li> <li>Point Nr 4</li> </ul> </div> pseudo javascript / jquery
$("#gallery ul li").first().duplicate(attachTo:"#gallery ul li") It looks like this:
<div id="gallery"> <ul> <li>Point Nr 1<p>lol</p></li> <li>Point Nr 2</li> <li>Point Nr 3</li> <li>Point Nr 4</li> <li>Point Nr 1<p>lol</p></li> </ul> </div How can I do it?:)
+4
2 answers