@ThatDevDiaz
Posted
I'm not 100% sure what you mean by animating the numbers but,
if you're referring to the " - -" and replacing it with the results, you should create an element : <span id="yearsResult">- -</span>
then in Javascript you're going to target this ID and store it like this:
let years = document.getelementbyid(yearsResult
);
Once stored, you're going to retrieve the results from (what I assume should have been the function calculating the years) and replace the span value with the results using basic dom manipulation. Store the results in a variable so you can then use template literals to display the results. Lets say you stored years in a variable called "calculatedYears". You can then do :
years.innerHTML = ${calculatedYears}
;
and your span value will now display whatever the calculatedYears value returned from the calculation function.
Hope this helped.
Marked as helpful
@henrikkudesu
Posted
@ThatDevDiaz This part of the project is working. There is an bonus challenge on the read.me file, which is: "See the age numbers animate to their final number when the form is submitted". I imagine it's to do some animation with the numbers in the output. For example, add n by n until you reach the output number so that it is animated in some way. I didn't quite understand either, but I think that's it.
@ThatDevDiaz
Posted
Ah I see what you mean. Yeah I’m not sure I fully understand either @henrikkudesu