Design comparison
Solution retrospective
First time using JavaScript in a project. All feed-backs are appreciated. Thank You.
Community feedback
- @DavidMorgadePosted about 2 years ago
Hello Gloryjaw, congratulations on finishing the challenge! as a first Javascript project you did a pretty good job!
The only little problem that I find with your App is that you can still submit the ratings even when no rating is selected, you can fix this by adding a condition in your function that checks if a rating was selected, try something like this (not tested):
submit.addEventListener('click', function () { if(rating === 0) return alert('Select a rating before submitting!') thankyoustate.style.display = "block" ratingstate.style.display = "none" variablerating.innerText = `You selected ${rating} out of 5` })
This will display a simple alert popup if no rating was selected! and will stop the function from working.
Hope my feedback helps you! if you have any question or if this doesn't work in your code, don't hesitate to ask, good job!
Marked as helpful3
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