Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Last active December 22, 2015 20:28
Show Gist options
  • Save ethagnawl/6526200 to your computer and use it in GitHub Desktop.
Save ethagnawl/6526200 to your computer and use it in GitHub Desktop.
Sum Harvest App Quantity Column
var inputs = [].slice.call(document.querySelectorAll('.quantity'));
inputs = inputs.filter(function (x) { return x.children[0] && x.children[0].classList.contains('js-change-total') });
inputs.reduce(function (x,y) { return x + parseFloat(y.children[0].value) }, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment