<table class="table">
<thead>
<tr>
<th>#</th>
<th>Id.</th>
<th>Descrição</th>
<th>Qtd.</th>
<th>Unitário</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<tr>
<th> 1 </th>
<td> 10</td>
<td> 20</td>
<td> 10 </td>
<td> 30 </td>
<td> 300 </td>
</tr>
<tr>
<th> 2 </th>
<td> 40</td>
<td> 50</td>
<td> 10 </td>
<td> 60 </td>
<td> 600 </td>
</tr>
</tbody>
</table>
<button
type="button"
class="btn"
id="btnexcluirultima">ExcluirUltimaLinha</button>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript">
$("#btnexcluirultima").on('click', function(){
//Excluir a ultima linha da tabela
$(".table td").closest('td').remove();
});
I need only delete the last row of the table! How do I, by the way, do the way I did, delete all the rows from the table ... what I did wrong, right away, thank you!