Design comparison
SolutionDesign
Solution retrospective
Hi! this is my solution for the tip calculator project. I struggled with the custom button (updating the value for that) and the updating of values when the input changes. Is there a smart way of doing this?
Community feedback
- @ErayBarslanPosted about 2 years ago
Hey, great work on the challenge! You can use
input
eventListener to achieve that. For custom input it would be:document.getElementById("custom__button").addEventListener('input', (e) => { calculateTipAmount(e, e.target.value / 100) })
You can apply the same to other inputs. Happy coding :)
0
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