Skip to content

Instantly share code, notes, and snippets.

@tikurahul
Last active October 12, 2015 12:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tikurahul/4024924 to your computer and use it in GitHub Desktop.
Save tikurahul/4024924 to your computer and use it in GitHub Desktop.
Bank of America (Filter Credit Card Summary with Keywords)
var transactions = $('.trans-desc-cell'),
// important -> keywords need to be uppercase (as we are not making a case insensitive comparison)
keywords = ['SEA', 'OAK', 'FRAN', 'EXPEDIA', 'ALASKA', 'TAXI', 'DELTA', 'MAX', 'PACIFIC'],
i = 0,
j = 0,
match = false,
content = null,
$t = null;
for (i = 0; i < transactions.length; i += 1) {
match = false;
$t = $(transactions[i]);
content = $t.html().toUpperCase();
for (j = 0; j < keywords.length; j += 1) {
if (content.indexOf(keywords[j]) >= 0) {
match = true;
break;
}
}
if (!match) {
$t.parent().hide();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment