Last active
October 12, 2015 12:08
-
-
Save tikurahul/4024924 to your computer and use it in GitHub Desktop.
Bank of America (Filter Credit Card Summary with Keywords)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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