How can I change each labels first character except the last labels character $ sign to £ using jQuery?
Here is the code:
<p align="center" id="myradio">
<label>$25.00 </label>
<input checked="checked" class="hide_input" name="amount" type="radio" value="25.00" />
<label>$50.00</label>
<input class="hide_input" name="amount" type="radio" value="50.00" />
<label>$100.00</label>
<input class="hide_input" name="amount" type="radio" value="100.00" />
<label>$250.00</label>
<input class="hide_input" name="amount" type="radio" value="250.00" />
<label>$500.00</label>
<input class="hide_input" name="amount" type="radio" value="500.00" />
<label>$1000.00</label>
<input class="hide_input" name="amount" type="radio" value="1000.00" />
<label>other amount</label>
<input class="show_input" id="other" name="amount" type="radio" value="" />
</p>
You can use the internal looping to swap the characters:
$("#myradio label").html(function(){
return this.innerHTML.replace( '$', '£' );
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With