Skip to content

Instantly share code, notes, and snippets.

@PeterTheOne
Created January 9, 2017 13:20
Show Gist options
  • Save PeterTheOne/1edfbcef89882d26f8787ccffd790360 to your computer and use it in GitHub Desktop.
Save PeterTheOne/1edfbcef89882d26f8787ccffd790360 to your computer and use it in GitHub Desktop.
Calculate total sum of all bbudget projects
var sum = 0; document.querySelectorAll('.campaign_budget').forEach(function(button) { sum += parseInt(button.innerHTML.substring(0, button.innerHTML.length - 1)); }); console.log(sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment