jQuery clone duplicate IDs

后端 未结 9 1866
醉梦人生
醉梦人生 2020-12-04 19:03

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

9条回答
  •  死守一世寂寞
    2020-12-04 19:50

    $("#MainConfig")
        .clone(false)
        .find("ul,li")
        .removeAttr("id")
        .appendTo($("#smallConfig"));
    

    Try that on for size. :)

    [Edit] Fixed for redsquare's comment.

提交回复
热议问题