skip to Main Content

How can a wrap the content of an element with a <a> tag with the help of jQuery

I have following setup: <div class="vc_acf organisation"> <span class="vc_acf-label">Organisation:</span> CLEMI</div> </div> I want to change it in: <div class="vc_acf organisation"> <span class="vc_acf-label">Organisation:</span> <a href="https://beglobal.toc-web.site/resources/clemi">CLEMI</a></div> </div> What I got so far: (function($) { $(".organisation").each(function() { $(this).html($(this).html().replace(/CLEMI/g, "<a href='https://beglobal.toc-web.site/resources/clemi'>CLEMI</a>")); }); })(jQuery); This…

VIEW QUESTION
Back To Top
Search