function checkAllCheckboxes(tableId, checkAllCheckboxId) { const table = document.getElementById(tableId); const checkboxes = table.querySelectorAll('input[type="checkbox"]'); const checkAllCheckbox = document.getElementById(checkAllCheckboxId); checkboxes.forEach(checkbox => checkbox.checked = checkAllCheckbox.checked); }