Skip to content

Instantly share code, notes, and snippets.

@ascott1
Created May 12, 2014 20:25
Show Gist options
  • Save ascott1/886fe14f65f48b252b3b to your computer and use it in GitHub Desktop.
Save ascott1/886fe14f65f48b252b3b to your computer and use it in GitHub Desktop.
var updateComparisons = function() {
$('.interest-cost').each(function( index ) {
var rate = $(this).siblings('.rate-compare').val(),
length = parseInt($(this).find('.loan-years').text(), 10),
totalInterest = interest(rate, length, details.amount),
$selector = $(this).find('.new-cost');
$selector.text(totalInterest);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment