i have the table below
<tr id="group_1>...</tr>
<tr id="el">...</tr>
<tr id="el">...<tr>
<tr id="group_2"></tr>
<tr id="el">...</tr>
<tr id="group_1>...</tr>
<tr id="el">...</tr>
<tr id="el">...<tr>
I need to find the last TR of each group
$("tr#group_"+groupID).next("tr#el:last").after("ADD NEW TR");
Its not working for me!!
I guess thats because i use for all groups the same id.
Can anyone help me.
Thanks
Well firstly IDs must be unique so behaviour is going to be undefined in your above case.
Secondly, that’s a difficult way to group rows. Try using TBODY elements instead>
and then things get much easier:
Thing is, you don’t even need to do it this way (using
after()). It’s easier to do it usingappend():