Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffreytgilbert/8186879 to your computer and use it in GitHub Desktop.
Save jeffreytgilbert/8186879 to your computer and use it in GitHub Desktop.
A little script to show the running balance on the chase cc page because they decided it's not important to keep a running balance...
(function(){
var amounts = document.querySelectorAll('#Posted tbody .amount');
var balance = Number(document.querySelector('#AccountDetailTable .card-accountdetailcol tbody tr td:nth-child(2)').innerText.substr(1).replace(',',''));
var iii=0;
var amount = '';
var element = null;
var elementsArray = [];
for(iii=0; iii < amounts.length; iii++) {
element = amounts[iii];
amount = element.innerText;
if(amount.substr(0,1) === '-'){
amount = amount.substr(2, amount.length-3);
amount = amount.replace(',','');
amount = amount * -1;
} else {
amount = amount.substr(1, amount.length-2);
amount = amount.replace(',','');
}
elementsArray.push({
'element':element,
'amount':Number(amount),
'order':iii
});
}
elementsArray.map(function(el){
el.element.style.whiteSpace = 'pre';
balance = Number(balance) - Number(el.amount);
el.element.innerHTML = '$'+el.amount.toFixed(2).toString()+' : $'+balance.toFixed(2).toString();
});
})();
@lucascolin
Copy link

This is awesome! Thanks Jeffrey!

All you have to do is open your credit card account activity page and run this script in the js console.

@goodcoder
Copy link

Don't work for me :) I also hate that they don't show running balance. I am switching to BOA for just this reason.

@petercdcn
Copy link

When I run the script, here is an error:
Uncaught TypeError: Cannot read property 'innerText' of null at :3:116 at :31:3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment