Skip to content

Instantly share code, notes, and snippets.

@hasangenc0
Created February 7, 2021 16:15
Show Gist options
  • Save hasangenc0/5cdd6647e9509971ac4ee24954d7cb94 to your computer and use it in GitHub Desktop.
Save hasangenc0/5cdd6647e9509971ac4ee24954d7cb94 to your computer and use it in GitHub Desktop.
table = document.querySelector("table");
sum = 0;
for (var i = 0, row; row = table.rows[i]; i++) {
for (var j = 0, col; col = row.cells[j]; j++) {
if (j ==2 && i > 0) {
sum += Number(col.innerHTML.replaceAll(',', ''));
}
}
}
console.log({sum});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment