JSFiddle - React, Tailwind, and code Playground

HTML

<div id="ProductCode"><span>Product number</span>2100022</div>

JavaScript

$('#ProductCode').contents().each(function () {
    if (this.nodeType == 3) {
        var elem = $('<a>', {
            href: "http://www.site.com/" + this.nodeValue,
            text: this.nodeValue
        });
        $(this).replaceWith(elem);
    }
});