Design comparison
Solution retrospective
At least i managed to get the code to run and the calculator to work.
What challenges did you encounter, and how did you overcome them?I just couldn't make the JavaScript code reuseable nor standard, the code has a very low performance.
What specific areas of your project would you like help with?I would love to get help in writing more standard JavaScript code. My javascript is very bad.
Community feedback
- @loiccapePosted 13 days ago
The calculator is not working; the button remains active after switching. There’s no error handling. For the button functionality, you just need to track the last clicked button in JavaScript. For example, if button one is clicked, set button.style.backgroundColor = 'green', and reset the background color of all other buttons. For error handling, track the value of your input fields. If the value is 0, display the <p> element containing the error message by setting display: block.
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