Skip to content

Instantly share code, notes, and snippets.

@rcstr
Created December 15, 2014 22:47
Show Gist options
  • Save rcstr/c5c746368d42c50e43b3 to your computer and use it in GitHub Desktop.
Save rcstr/c5c746368d42c50e43b3 to your computer and use it in GitHub Desktop.
ie7
function paymentCheck() {
var obj = {
'type': 'car',
'year': 2008,
'make': 'Dodge',
'model': 'Avenger',
'payments': 'in process',
'paid': 13286,
'toBePaid': 34856,
'paymentsLeft': 24,
}
return (obj.toBePaid - obj.paid) / obj.paymentsLeft;
}
var button = document.getElementById("calcButton");
if (button.addEventListener) {
button.addEventListener("click", function() {
alert(paymentCheck());
}, false);
} else {
button.attachEvent("onclick", function() {
alert(paymentCheck());
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment