I'm trying to style the asterisk ("*") inside the span element of a required field based on the "input:valid" property.
<apex:input value="{!firstName}" id="firstnameId" required="true" />
<label class="lbStyle" for="FirstName"> First Name
<span class="ddff" style="color:red;">*</span>
</label>
I want to change the color of the "*" From Red to Green, If the input is valid.
How can I achive it using css?
I tried this :
input:valid .ddff {
color: palegreen;
}
But it not working.
I know I can do it in JS as well, but I have a lot of fields to change so I would like a css way if it is possible.
Thanks!