Basically I have a series of divs which contains a label and an input element in each one of them. Some of these labels have a “” to denote a required field. I’d like to create a jQuery function to check all label elements for the “” and if it finds it, to change its colour to red. I’ve no idea how I could accomplish this.
What I have at the moment:
<label for="ccf_name">* Your Name:</label>
<label for="ccf_name">Your Address:</label>
I’d like to change the <label class="">* Your Name:</label> to <label class=""><span class="red">*</span> Your Name:</label>
Any ideas?
This should do it
demo at http://jsfiddle.net/gaby/b5ghj/1/