@Tactenator
Posted
Hello! Your solution looks good! As for your questions:
-
Based on your code, when someone clicks on your span, it will add the class 'clicked'. However, there is no code to remove code from another span when another one is clicked. To resolve this, what you can do loop through each span in your query selector to check if it has the 'checked' class. If it does, the loop can remove the clicked class, and allow you to add 'clicked' to the correct div the user clicks.
-
As for the correct rating, that can be done by grabbing the inner text of the span much like you have now.
I hope this helps! Have a good one!