Created
December 15, 2014 22:47
-
-
Save rcstr/c5c746368d42c50e43b3 to your computer and use it in GitHub Desktop.
ie7
This file contains hidden or 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
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