JSFiddle - React, Tailwind, and code Playground

HTML

<div class="item">
   Text that needs to be wrapped.
   <span class="count"></span>
   Text that needs to be wrapped.
</div>

CSS

.item {color: Black}
.new {color: Red}

JavaScript

var txt = $('.count')[0].prev;
$(txt).wrap('<span class="new" />');