I am really new to JavaScript and jQuery. I have a form where I have all the required field labels appear with an asterisk (I can't change the HTML) and I plan to remove that and instead add a custom asterisk with its own class.
I am unable to remove the askterisk whatsoever. It would be great if you could assist. All my required field labels appear in the following class - "reg-required-field".
Following is the Markup for one of the field and label.
<div class="reg-field-container">
<div class="reg-process-row">
<div class="reg-field-left-column">
<label class="reg-required-field" for="ctl00_ContentPlaceHolder1_tbxFirstName">*First name:</label>
</div>
<div class="reg-field-right-column">
<input name="ctl00$ContentPlaceHolder1$tbxFirstName" maxlength="30" id="ctl00_ContentPlaceHolder1_tbxFirstName" type="text">
</div>
</div>
</div>
The JavaScript that I created -
var myString = document.getElementsByClassName("reg-required-field").textContent;
var newString = myString.slice(1,myString.length);
Thanks!