I'm currently working in an environment where I can't change the HTML structure.
I'm trying to make a star rating form. I have been able to do 75% of it but now I'm stuck and looking for help.
here the structure :
<div class="input">
<ul class="inputs-list multi-container">
<li class="hs-form-radio">
<label class="hs-form-radio-display">
<input class="hs-input" type="radio" value="Very Disatisfied">
<span>Very Disatisfied</span>
</label>
</li>
<li class="hs-form-radio">
<label class="hs-form-radio-display">
<input class="hs-input" type="radio" value="Disatisfied">
<span>Disatisfied</span>
</label>
</li>
<li class="hs-form-radio">
<label class="hs-form-radio-display">
<input class="hs-input" type="radio" value="Correct">
<span>Correct</span>
</label>
</li>
<li class="hs-form-radio">
<label class="hs-form-radio-display">
<input class="hs-input" type="radio" value="Satisfied">
<span>Satisfied</span>
</label>
</li>
<li class="hs-form-radio">
<label class="hs-form-radio-display">
<input class="hs-input" type="radio" value="Very Satisfied">
<span>Very Satisfied</span>
</label>
</li>
</ul>
</div>
and my css code:
@import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
label > input:before {
/*margin: 5px;*/
font-size: 1.25em;
font-family: FontAwesome;
display: inline-block;
content: "\f005";
}
label > input:checked,
label:not(:checked) > input:hover{ color: #FFD700; }
li {list-style:none;}
Up to now, when an input is checked the star is yellow and when I hover over another star they become yellow as well.
What I'm not able to do is to make previous stars yellow. So if I clicked on the third star, I would like star 1&2 to be yellow as well.
Any help would be appreciated. Let me know if you need more details! Thanks