JSFiddle - React, Tailwind, and code Playground

HTML

<div> I'd like to keep this text but remove: <span class="one_span">this span</span> and also <span class="one_span">THIS SPAN</span></div>

JavaScript

var myText = $('div').contents(':not(.one_span)').text();

alert(myText);