Changing various id's after cloning in jquery

后端 未结 3 781
离开以前
离开以前 2020-12-06 02:14

I\'m trying to clone a table row and update the multiple id\'s to reflect the input fields. I start by doing this and it works:

$(id).clone().attr(\"id\", \"         


        
3条回答
  •  天涯浪人
    2020-12-06 03:07

    I have found when I do a lot of .clone() stuff it is better to use a class rather than an id attribute. This way you can clone, yet reference it by a known entity (the class), and still get unique via an index into the element group via an .eq()

提交回复
热议问题