Submitted almost 3 years ago
Frontend Mentor - Tip calculator app solution
@Prajwol-Shrestha
Design comparison
SolutionDesign
Solution retrospective
Any Feedback is welcomed. Also how can i remove class from my tip items when i select more than one tip.
Community feedback
- @aboAbassAlshaegePosted almost 3 years ago
Welcome !
You can remove the ( active ) class from the options by looping like the following :
let allOptions = document.querySelectorAll(" .options"); allOptions.onclick = (event) => { allOptions.forEach( (element) => { element.classList.remove("active"); } ) event.target.classList.add("active"); }
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