Design comparison
Solution retrospective
I think I'm not using the best solution for the JavaScript, if you know a more efficient way of doing it, please let me know!
Community feedback
- @yishak621Posted almost 2 years ago
Good design and everything except the event fires when a user gets back to the rate percent buttons and it shouldn't be like that ...if the button is not provided for an input we have two ways of event to listen
keyup
orinput
events so in these case listening to a keyup events(when a user types a value and the moment he stops typing) it calculates the result and display it ...it doesn't need him to get back and press a btn//Main event Functionallity-keyup events userInput.addEventListener('keyup', () => { //calculating the amount of tip.......
since i can't explain all in here ..u can refer my result in github
Marked as helpful1
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