I'm struggling with how best to do this and am hoping for some advice.
For all of the inputs in this form, I need to split the label at the colon (:
) and wrap a span around the latter half of the label, to achieve something like this: <label>Regular: <span class="price">$135 (1 Year) or $225 (2 Year)</span></label>
.
Would RegEx be the best route to implement this? I'm not sure how to go about it, this is a little more complex than my knowledge of RegEx.
<div class="form-item webform-component webform-component-radios" id="webform-component-discount-options">
<div id="edit-submitted-discount-options" class="form-radios">
<div class="form-item form-type-radio form-item-submitted-discount-options">
<input type="radio" id="edit-submitted-discount-options-1" name="submitted[discount_options]" value="none" class="form-radio">
<label class="option" for="edit-submitted-discount-options-1">Regular: $135 (1 Year) or $225 (2 Year) </label>
</div>
<div class="form-item form-type-radio form-item-submitted-discount-options">
<input type="radio" id="edit-submitted-discount-options-2" name="submitted[discount_options]" value="senior" class="form-radio">
<label class="option" for="edit-submitted-discount-options-2">Senior: $108 (1 Year) or $180 (2 Year) </label>
</div>
<div class="form-item form-type-radio form-item-submitted-discount-options">
<input type="radio" id="edit-submitted-discount-options-3" name="submitted[discount_options]" value="student" class="form-radio">
<label class="option" for="edit-submitted-discount-options-3">Student: $81 (1 Year) </label>
</div>
<div class="form-item form-type-radio form-item-submitted-discount-options">
<input type="radio" id="edit-submitted-discount-options-4" name="submitted[discount_options]" value="nonresident" class="form-radio">
<label class="option" for="edit-submitted-discount-options-4">Non-Resident: $108 (1 Year) or $180 (2 Year) </label>
</div>
</div>
</div>