New to javascript! This works, but I have a lot more to do, and it would be great if there was a cleaner way to do this.. open to using jquery if neccesary :)
(stack
I'd do it something like this:
function apply() { var backers = 0; for (var i = 1; i < 20; ++i) { backers += parseInt(document.getElementById("backer-prediction-" + i).value); } document.getElementById("backer-prediction-answer").value = backers; }