javascript - Copy <li> and insert them after themselves -


i want copy contents of each of <ul>'s of selected class, that

<ul class="testowyul">   <li>a</li>   <li>b</li>   <li>c</li> </ul> 

will change

<ul class="testowyul">   <li>a</li>   <li>b</li>   <li>c</li>   <li>a</li>   <li>b</li>   <li>c</li> </ul> 

it seemed simple, reason cannot make work. problem is, i'm using class (as there going multiple lists of type), , not know how select <ul> , perform clone() , append(). tried chaining $(".testowyul").children().clone().after(".testowyul"); didn't work.

use $.append() function argument:

$(".testowyul").append(function(){return $(this).children().clone();}); 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

python - Received unregistered task using Celery with Django -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -