@Alone-07
Sandra
@sandrj1All comments
- @sandrj1
Hello! 👋 Everything looks nice! I would only suggest two things:
- You could use <input type="number"> instead of <input type="text"> so the user won't be able to type strings and you would avoid displaying "$NaN" as your result.
- When the number of people is 0, I would add a control so that your output will never show "$Infinity".
For example, you could add this to your code:
If (peopleValue > 0) {
tipAmount.innerText = totaltip; personAmount.innerText = person;
}
Hope this helps! You did a really good job :)