I have this label:
<div id="edit-my-radios-0-wrapper" class="form-item">
<label class="option" for="edit-my-radios-0">
<input id="edit-my-radios-0" class="form-radio" type="radio" value="0">
£25
</label>
Which I want to change the value of using JQuery. Unfortunately I have no control over how it is created, and with an id, I'm not sure if it's even possible to target it.
Does anyone have nay idea how to target it?
Thanks in advance..
I realize this question is about a year old, but I thought I'd answer it anyway...
To select/target a label that doesn't have an id, you can use the value in for=
as follows:
$('label[for=edit-my-radios-0]').html('New Label Here');
I'm assuming that by value you mean the HTML inside of the label. You can select the label by the class name.
$('.option').html('[Your HTML here']);
Take a look at the jQuery selectors.
Try this
$("div.form-item lable.option").html("ValueToChange");
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