Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Pricing component with toggle

@rickyhewitt

Desktop design screenshot for the Pricing component with toggle coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


For rotating the switch/toggle, I used css rotate within an event handler.

document.getElementById("switch_img").style.rotate = "180deg";

Would be interested to know how others would have done this.

The bonus objective stated that optionally only HTML/CSS could be used, however without JS I am not sure how.

As always, any advice on best practices is also welcome.

Thanks!

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

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