Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
05-21-2010, 09:16 PM #1
- Join Date
- May 2010
- Thanked 0 Times in 0 Posts
Question about changing element id's when cloning a table row in jquery
Hello, I'm new to the forum and also to jquery, so please forgive my ignorance on the matter.
What I have is a dynamic form used for calculating the area of shapes. The form is empty at first, but when you click on a button with a shape you want to calculate you get a table row that looks like this in code:
<tr id="row1"> <td><input type="text" id="shape_a_1"></td> <td><input type="text" id="shape_d_1"></td> <td><input type="text" id="shape_c_1"></td> </tr>
$(id).clone().attr("id", "row" + newId).insertAfter('#row' + oldId).find("#shape_a_" + oldId).attr("id", "shape_a_" + newId);
find(":input:eq(0)"), but that would change the id's of the table row I was copying from and not my new table row. Any suggestions?