How to select part of the text in the tag and wrap in a link?

There is a piece of code in the feedback form

<div class="form-group field-contactform-privacy required">

<input type="hidden" name="ContactForm[privacy]" value="0"><label><input type="checkbox" id="contactform-privacy" name="ContactForm[privacy]" value="1" checked=" "> I agree with the privacy policy</label>

<div class="help-block"></div>
</div>


You need to wrap part of the text - namely "privacy policy" in the link - the possibility to do it via html, there, interested in how it can be implemented using JS or JQ.

The output should look something like this:

<div class="form-group field-contactform-privacy required has-success">

<input type="hidden" name="ContactForm[privacy]" value="0"><label><input type="checkbox" id="contactform-privacy" name="ContactForm[privacy]" value="1" checked=" " aria-invalid="false"> agree with <a href="link">privacy policy</a></label>

<div class="help-block"></div>
</div>
June 14th 19 at 19:20
1 answer
June 14th 19 at 19:22
Solution
And it was there and had input, the checkbox to add but in General the decision came - thank You! - garfield.Koss commented on June 14th 19 at 19:25

Find more questions by tags HTML