Within each tr
there are several buttons
(add and remove) and their respective td
(s), how do I know that certain tr
should I delete if I click on one of the add or rem buttons? Also wanted to add a new tr
of class patients just below the other three?
The jsfiddle follows:
link
<table id="tabela-1">
<tr>
<th>Nome</th>
<th>Peso(kg)</th>
<th>Altura(m)</th>
<th>IMC</th>
</tr>
<tr class="paciente">
<td class="info-nome" id="nome-1">Leonardo</td>
<td class="info-peso" id="peso-1">57</td>
<td class="info-altura" id="altura-1">1.67</td>
<td class="info-imc" id="imc-1"></td>
<td><input type="button" class="btnadd" value="+" /></td>
<td><input type="button" class="btnadd" value="-" /></td>
</tr>
<tr class="paciente">
<td class="info-nome" id="nome-2">Paulo</td>
<td class="info-peso" id="peso-2">100</td>
<td class="info-altura" id="altura-2">2.00</td>
<td class="info-imc" id="imc-2"></td>
<td><input type="button" class="btnadd" value="+" /></td>
<td><input type="button" class="btnadd" value="-" /></td>
</tr>
<tr class="paciente">
<td class="info-nome" id="nome-2">Paulo</td>
<td class="info-peso" id="peso-2">100</td>
<td class="info-altura" id="altura-2">2.00</td>
<td class="info-imc" id="imc-2"></td>
<td><input type="button" class="btnadd" value="+" /></td>
<td><input type="button" class="btnadd" value="-" /></td>
</tr>
<tr class="paciente">
<td class="info-nome" id="nome-2">Paulo</td>
<td class="info-peso" id="peso-2">100</td>
<td class="info-altura" id="altura-2">2.00</td>
<td class="info-imc" id="imc-2"></td>
<td><input type="button" class="btnadd" value="+" /></td>
<td><input type="button" class="btnadd" value="-" /></td>
</tr>
</table>