How can I append a table row with jquery to the "parent table"?
For example if I have a table with an inner table:
<table id="table_1">
<tr>
<td><table id="table_2">
<tr>
<td></td>
</tr>
</table></td>
</tr>
</table>
If I use this code:
- $.get("../php/new_row.php", {id: id}).done(function(data) {
- $('#table_1 tr:last').after(data);
- });
It applies the new row to the table_2 and not the table_1...
And if I apply this code:
- $.get("../php/new_row.php", {id: id}).done(function(data) {
- ('#table_1 > tr:last').after(data);
- });
Nothing happens and chrome's log doesnt show an error...please help me, I dont understand why this happens if I'm specifying table_1...Thanks!!