Design comparison
Solution retrospective
Hi, I submit my solution but I am not able, for some reason, to make the "submit" button work. Any advice on this ? I've read my code over and over but I am not able to find the problem... Thanks
Community feedback
- @EileenpkPosted over 1 year ago
Hi Pierre,
I sent a pull request to your project on GitHub with the changes made, I see that other people have already answered your question and helped you debug, but I wanted to let you know to look on GitHub if you wanted to practice pull requests and merging.
Hope this was helpful!
Marked as helpful0 - @sanderdecheringPosted over 1 year ago
You are adding and removing the class 'hidden' inside the click event, but there is no hidden class in your css file.
submitBtn.addEventListener('click', () => { if (rate) { ratePoint.innerText = rate; ratingSection.classList.add('hidden'); thankSection.classList.remove('hidden'); } });
You are using the hidden attribute on your html element.
<div class="thank-section" hidden>
Here is what you could do:
- Create a hidden class in your css file.
.hidden{ display: none; }
- Remove the hidden atribute from
<div class="thank-section" hidden>
and add the hidden class
<div class="thank-section hidden" >
This should fix your problem.
Marked as helpful0 - @visualdennissPosted over 1 year ago
Looks good overall. Congrats on completing the challenge successfully.
Regarding your issue:
Here it looks like you are trying to remove the classList: thankSection.classList.remove('hidden');but there is no class called hidden, so looks like you wrote it outside of class names here:
<div class="thank-section" hidden> Also u can add some console.log() to rate and to ur event listener of button to debug the issue if it still persists.One more tip: You might consider removing the border from the button for a better look and match the design more :)
Hope you find this feedback helpful!
Marked as helpful0@PierreFrsPosted over 1 year ago@visualdenniss thank you, now it works ! I remember now that I saw it and did not understand why the guy created a "hidden" class instead of writing it directly in the HTML (I did it with an help from a video). Cheers
1@visualdennissPosted over 1 year ago@PierreFrs Glad to hear it works now and my suggestion was helpful! :)
Marked as helpful0
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