Question
Need some help with JQUERY code changes will be made in the future_value.js file. You will be creating a calculateClick function that will fire when
Need some help with JQUERY code changes will be made in the future_value.js file.
You will be creating a calculateClick function that will fire when the button with the ID calculate is clicked.
This function should ensure that the investment, rate and years have valid numbers and is greater then zero.
Hint - isNaN(investment) || investment
If all of them are valid I want you to then run the math formula to calculate the future value. You will need to loop through the amount of years.
Also note that in your for loop you need to use a running total
Hint variable += formula.
After you have looped through the years and have your total, you need to display it in the #future_value input box. Make sure your total variable has the .toFixed() method on it, for full numbers.
Hint look at .val() in JQuery for getting and setting values.
Future value js file i started
var calculateClick = function () { // Your code goes here.
}
$(document).ready(function() { $("#calculate").click(calculateClick); $("#investment").focus(); });
the HTML :
Future Value Calculator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started