<div class="registrationField BIRTH_DATE">
<span class="registrationlabel BIRTH_DATE">
<label for="registrationTextField_3">Birth Date (M/D/YY)</label>:
<span class="registration_requiredCue">*</span>
</span>
<input class="registrationInput registrationTextField BIRTH_DATE" id="registrationTextField_3" type="text"></div>
I want to change the text of the label (in this case 'Birth Date (M/D/YY)') however since the label is does not have a class or ID I can't quite figure out how to do so. Unfortunately I don't have access to the HTML portion of this form, so I need to rely on jQuery to change the label. I've tried over a dozen methods (most from similar questions on this site). The best I've been able to do is hook into the out span, but because of how the form is generated I can't guarantee that the label will be the same each time so I can't just replace that.
My current iteration doesn't work at all.
$(document).ready(function(){$(".registrationlabel.BIRTH_DATE").contents().filter(function(){return this.nodeType === 3;}).find("Birth").replaceWith("Death");});
find('Birth')is not valid.Birthis not a valid selector string.label[for="registrationTextField_3"]?