0
In a reference HTML table, the tag <tfoot>
is accessed and has its data modified [not included here because it is working], and when using the method .clone() jQuery to create a deep copy for the clone table, the contents of <tfoot>
is cloned correctly but the value that has been modified in the reference table is not sent to the clone table, which is cloned are the static initial data by default, such as cloning what is also modified in the DOM
from the reference table to the clone table, which is missing?
jQuery helped me build the function below and it works, but as I mentioned, it does not create deep copy with the DOM
modified.
<table class="ref">
<thead></thead>
<tbody>
<tr>
<td>
<input type="checkbox" name="check">
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Conteúdo default</th>
<tr>
</tfoot>
</table>
<table class="clone">
<thead></thead>
<tbody></tbody>
<tfoot>
</tfoot>
</table>
<script>
$('table.ref input[type="checkbox"]').change(function () {
let $cloningFoot = $('table.ref tfoot tr').clone();
$('table.clone tfoot').html($cloningFoot);
});
</script>