JSFiddle - React, Tailwind, and code Playground

by hamix

HTML

<div class="content">
  <p>somecontent</p>
  <p>another content <span id="name-1">content</span> 1234214</p>
</div>

JavaScript

$('.content p').html(function(index, value) {    
    return $(this).text().replace(/(\d+)/g,"new val");
});