So I need to create three input fields with one button. One input field for a date, one for an amount of money and one for an interest rate. When clicking on the button an overview of the sum must be displayed over the course of the next years until its doubled using the given interest rate.
My question is how can I loop through these years until the sum is doubled. The rest of the code I have and works.
I'm new to javascript and coding and would appreciate anyones help.
This is the code I have right now:
s = sum
d = date
r = interest rate
for (var i = 0; i < s; i++) {
result.innerHTML += d + " " + ((r / 100 + 1) * s) + "<br>";
}
The complete code : https://jsfiddle.net/swateen/bjah4rc0/