3
How can I remove a row from a table by clicking on an icon check, and clicking on the icon erases the task with id="next tasks" and adds to the table with id="myTarefas"
I was able to remove it from one table, but I can’t guess another. What can I do?
I cannot use jquery.... Javascript only
Follow the code I’ve already made:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css">
</head>
<body>
<table class="table table-striped" id="proximasTarefas">
<thead>
<tr>
<th>Tarefa</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
<tr>
<td>Preparar a campanha de adoção</td>
<td class="text-center"><i class="fa fa-check"></i></td>
</tr>
<tr>
<td>Contactar os adotantes da Mamã</td>
<td class="text-center"><i class="fa fa-check"></i></td>
</tr>
<tr>
<td>Levar o Zazu ao veterinário</td>
<td class="text-center"><i class="fa fa-check"></i></td>
</tr>
<tr>
<td>Consultar a FAT da ninhada de Garfe</td>
<td class="text-center"><i class="fa fa-check"></i></td>
</tr>
</tbody>
</table>
</body>
</html>
The Java I made to remove was this:
function removeLinha(linha) {
var i=linha.parentNode.parentNode.rowIndex;
document.getElementById('tabProximasTarefas').deleteRow(i);
}
But I wanted to put the task that excludes, for example, Preparing the adoption campaign, in another table whose id="myTarefas"
I’ll try it :) Thank you :)
– Ana Xavier Fernandes
didn’t work :(
– Ana Xavier Fernandes