Pricing component with toggle with HTML5, CSS3 and JavaScript
Design comparison
Solution retrospective
I didn't get to use only HTML and CSS. For some reason that I don't know to explain I didn't get to hide and show the price with CSS only. I finished the project, but it's not working perfectly. My JS code doesn't work as it was waiting. If you code in JavaScript, could you review my code? Thank you! Since now!
Community feedback
- @mattstuddertPosted almost 5 years ago
Hey Van, nice work on this challenge! Using JS to complete it is absolutely fine. Your JS code looks good too. One small thing is I'd set the elements to display
block
as opposed toinline-table
but that's a really small thing.One larger change I'd recommend making would be to avoid using
visibility: hidden;
for the toggleinput
. Using it hides the element for screen reader users, so it makes the element inaccessible to people using assistive technologies to navigate the page. Here's a great tactic for hiding content in an accessible way.I hope that helps. Keep up the great work!
1@vanribeiroPosted almost 5 years ago@mattstuddert, thank you about your feedback! It is really important to me! π **About
block
/inline-table
- ** I tried to set the property withblock
but when I run the code it isn't working nice. Maybe because I use a table structure to show the prices datas. The only it was running ok it was theinline-table
... π€·π **Aboutvisibility: hidden
- ** I really liked this hint and I updated my code! Thank you very much again!1@mattstuddertPosted almost 5 years ago@vanribeiro ah OK. I didn't see that you were using a table layout. It makes sense now.
1
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