How can I remove a line from a table by clicking on an icon check, and clicking the icon, delete the task with id="nexttasks" task and add it to the table with id="mytasks"
I was able to remove from one table but not add another. What can I do?
I can not use jquery .... Javascript only
Here is the code I've already done:
<!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 javaScript 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="my Tasks"