I have an HTML element with a large collection of unordered lists contained within it. I need to clone this element to place elsewhere on the page with different styles adde
Here is a solution with id.
var clone = $("#MainConfig").clone(); clone.find('[id]').each(function () { this.id = 'new_'+this.id }); $('#smallConfig').append(clone);
if you want dynamically set id, you can use counter instead of 'new_'.