I have the below fiddle for my fieldset star rating selector:
https://jsfiddle.net/bxd107gv/
It's designed to default to 5 stars but the user can then click one to amend the selection to a lesser value if appropriate but; I think the style:
.rating > label{
color:#FFD700;
}
Is interfering by applying that so I tried doing a mouseover event in JS to set the star back to it's default colour but that has the exact same issue but with a different colour; how do I amend this so that only the stars that are selected are highlighted yellow and the rest are grey after the user changes from 5 stars to any other value?
You can add a class to the container to mark the rated status when rating, and add an additional rated css to the label in the rated container:
document.getElementById('starRatingSelection').classList.add('rated');
.rated > label{
color: #a5a5a5;
}