Skip to content

Instantly share code, notes, and snippets.

@HennerM
Created October 19, 2016 06:58
Show Gist options
  • Select an option

  • Save HennerM/d9d8206ae3c567b4df8118346b9d32d9 to your computer and use it in GitHub Desktop.

Select an option

Save HennerM/d9d8206ae3c567b4df8118346b9d32d9 to your computer and use it in GitHub Desktop.
if (typeof grades == "undefined") {
var grades = {};
}
$("#ctl00_ctl00_ctl00_MainArea_MainArea_ContentArea_gvGrades tr").each(function() {
var name = $(this).find("td:nth-child(4)").text().trim();
var value = parseFloat($(this).find("td:nth-child(3)").text().trim());
if (typeof grades[name] == "undefined") {
grades[name] = value;
} else {
grades[name] += value;
}
})
console.log(grades);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment