Design comparison
SolutionDesign
Solution retrospective
I have made this with basic HTML, CSS, and javascript. A lot of work is needed to make the code shorter but for now, it's complete and responsive as well. Anyone can tell me why my buttons are not toggling. I have marked them in the files can you guys please check them and tell me?
Community feedback
- @mikhailkollenPosted almost 2 years ago
Hello! Not sure if I could help you with your approach, but I think you could try the following:
- In JS select the parent button container (you have already done it, as I see);
- Check if the container has the class "active-btn" and toggle it on click;
- Then, change toggle_btn.innerHTML depending on the class.
I've created a CodePen for you as a suggestion: https://codepen.io/mikhailkollen/pen/WNKRYPz?editors=1111
Something like this. Hope it helped!
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