I'm trying to get the table data from some columns and I've tried a couple of variations I could think of, but none worked:
function updateAllTasks() {
var table = document.getElementById("dtable");
var [, ...tr] = table.querySelectorAll("tr");
var tableData = [...tr].map(r => {
var td = r.querySelectorAll("td");
console.log([...td].map(c => c[0].innerHTML, c[1].innerHTML, c[8].querySelectorAll('input[name="rowcheckbox"]')[0].value)); //This is the one giving me error ReferenceError: c is not defined
})
console.log(JSON.stringify(tableData));
}
Thanks for your help!