Interactive Rating Component

Solution retrospective
Edit: Thanks to suggestions from @elyyyse I was able to resolve the issue...
Hi community! This is an incomplete project but I wanted to go ahead and submit it to get some feedback. This is my first project using Javascript.
For the most part I got everything to work, however I was unable to get the message that shows after the user clicks submit, to update according to the score selected. My populateScore function runs, but the score variable within it only recognizes that element that originally has the "selected" class. Even if it updates in the html file, which I can see in real time using the browser's developer tools.
Any help on what I am missing or doing wrong would be greatly appreciated!
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@elyyyse
Hey, CJ - You're so close! If you run your
populateScore();
function inside of your submitButton event listener, it should work. The way you have it running,score = document.querySelector(".number.selected").textContent;
is looking for an element that's already hidden.
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