Design comparison
SolutionDesign
Solution retrospective
This was a fun one! Any feedback is appreciated and welcomed!
I couldn't figure out how to only let the user select only one option.
Community feedback
- @goyal-DushiPosted about 2 years ago
So, to answer your doubt, you need to maintain a variable state of the button that has been clicked in your clicked function and then, when next time user clicks any button, you need to check if it the same or different button that has been clicked by comparing with the state variable.
- if same, then do nothing and return
- if different button, the removed all the styling applied to state variable button ( the previous button clicked ) , update the state variable with new button, and apply required styling to new button.
Also, use ' ./ ' for you image paths, ( relative path ) , so that it can find your images. Currently on website, images aren't loading !
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