JSFiddle - React, Tailwind, and code Playground
HTML
<div id="foo"> <span>
<a href="#" class="no-want">X</a>
1
</span>
<span>
<a href="#" class="no-want">X</a>
2
</span>
<span>
<a href="#" class="no-want">X</a>
Hello
</span>
</div>
<h3>results</h3>
<pre></pre>
JavaScript
var values = $('#foo').children().map(function () {
var $clone = $(this).clone();
$clone.children().remove();
return $.trim($clone.text());
}).get();
$('pre').text(JSON.stringify(values, null, ' '))
console.log(values)