Reputation: 18680
I have this jQuery code:
html += '<tr>';
html += '<td>AAA</td>';
html += '<td>BBB</td>';
html += '<td>CCC</td>';
html += '<td>DDD</td>';
html += '<td>EEE</td>';
html += '<td>FFF</td>';
html += '</tr>';
$(html).appendTo("#fabricanteBody");
$(html).appendTo("#selFabricanteBody");
How do I remove the last td
(html += '<td>FFF</td>'
) element on the html
var before append it to #selFabricanteBody
?
Upvotes: 0
Views: 547
Reputation: 24001
$('tr > td:last-child').remove();
or
$('tr > td').last().remove();
Upvotes: 10