Design comparison
SolutionDesign
Solution retrospective
Hello, community!
Any advice on the topics below will be appreciated!!
- Better HTML (DOM) structuring/ BEM technique
- Writing clean and reusable code in JavaScript (this challenge is small, but if there's anything I can improve upon, let me know!)
Happy coding☕️✨
Community feedback
- @adamwozherePosted over 2 years ago
Hi,
You might find it easier to use a set of radio buttons within your form; you can hide the actual input with CSS then style the label to look like the buttons as in the design. It also makes accessing the data in JS very easy:
<input type="radio" name="rating" value="1" id="rating-1"> <label for="rating-1">1</label> // JavaScript let selectedRating = form.rating.value;
Hope this helps :)
Marked as helpful1@TSune-webPosted over 2 years agoThank you, @adamwozhere!
That was one of the parts that I wasn't sure how to implement! Your advice looks neat and makes more sense. I'll definitely try that approach.
That really helps! Thank you!!
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