@Ratified
Posted
Hello @aboobaqr
You did a really good job on this. Wow.
However, instead of selecting all the stars manually in your script, you can use a for loop to iterate through the whole list, here's how:
const stars = document.querySelectorAll('.rating-btn a'); stars.forEach(function(star) { star.addEventListener('click', function(){ //Implement your logic here }) });
With this you'll achieve the same functionality but with less javascript code. I hope this helps.
Happy coding man.
Marked as helpful
@aboobaqr
Posted
Thank you so much @Ratified