Search code examples
jquerycloneprepend

jQuery How to clone() more than one time


i'v clone some elements list, but i need to clone it more than one time, can you tell me how to do it?

$('.main_content ul li').clone().prependTo('.main_content ul')

Much thx for help.


Solution

  • Try this maybe?

    var objToClone = $('.main_content ul li');
    for (var i = 0; i < 10; i++)
       objToClone.clone().prependTo('.main_content ul');