Tip Calculator using JS and SCSS

Solution retrospective
Hello everybody!
Finished my second challenge in JavaScript. This one was interesting! Add some problems with SCSS, for JavaScript it was alright. However, if anybody did this challenge, I will gladly take any advice on the JS (mainly if there is a way to reduce the amount of document.getElementById).
Please log in to post a comment
Log in with GitHubCommunity feedback
- @achrustowski
Hi Leo!
I really like your solution, logic works as expected and everything does it's job as it should, well done! :)
As for reducing the amount of
getElementById
I don't think there is any other way if you're using vanilla JavaScript (I've done my solution similar way to yours). Only thing I'd change in order to make your life easier IF you had to edit your JS code, I'd putthrowErrorMessage
selectors into variables same as you did for buttons and inputs.Great job!
Marked as helpful
Join 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