Design comparison
Solution retrospective
The styling without having the designs was tricky.
For the javascript part, it was a challenge to have everything calculated correctly. I also have put everything in a ES6 Class + constructor.
The calculation is updated when changing the total bill, the tip percentage, and the number of people. The sequence doesn't matter for inserting the data.
I added an additional error check for the Number of People input. Besides a zero check, I also check if a non-number character is inserted and show an error message if the user enters one.
It isn't that user-friendly if you have to hit the Reset button to start a new Tip calculation.
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord