I want to clone of this TR of a perticular table and changed its id accordinlgly.
<tr id="tr">
<td class="row form-group">
<input type="text" name="name" id="first">
</td>
<td class="row form-group">
<input type="text" name="name" id="second">
</td>
<td class="row form-group">
<input type="text" name="name" id="third">
</td>
<td class="row form-group">
<input type="text" name="name" id="forth">
</td>
<td class="text-center">
<a href="#" disabled="disabled">
<i class="fa fa-trash-o"></i>
</a>
</td>
</tr>
I have tried so far.
var cloneCount = 1;
$("#tr").clone().attr('id', 'id'+ cloneCount++).insertAfter("#tr");
but this is not liking to me.
Update :
It generate/update id of TR but really i don't want this, actually i wanted to do is changed id's like first0,second0,third0,forth0 and first1,second1,third1,forth1 and so on.
hope you understand all.