Skip to content

Instantly share code, notes, and snippets.

@sam-mccall
Created January 4, 2012 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam-mccall/1562108 to your computer and use it in GitHub Desktop.
Save sam-mccall/1562108 to your computer and use it in GitHub Desktop.
Filtering ASB account statements
var ary = function(x) { return Array.prototype.slice.apply(x); };
ary(document.querySelectorAll('#statementTable tr:not(.columnTitles)')).forEach(function(x) {
var cols = ary(x.querySelectorAll('td')).map(function(y) { return y.innerText; });
if (cols[2] == '' && cols[3] != '') x.classList.add('credit');
if (cols[2] != '' && cols[3] == '') x.classList.add('debit');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment