1
Inside eachtr
there are several buttons
(add and remove) and their respective td
(s), how to know which given tr
should I delete if I click one of the add or rem Buttons? I also wanted to add a new one tr
class patients just below the other tr?
Follow the jsfiddle:
http://jsfiddle.net/nn40pty3/
<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>
didn’t understand? What you need to add or remove?
– Adir Kuhn
if I click the remove button, one should remove the TR that was clicked (remove it add); if I click the add button, add a new TR
– chocolatemontana
Why are both buttons classy
btnadd
? I can change one of them tobtnremove
?– Sergio
can, is that copy/Paste and forgot to change values
– chocolatemontana