JSFiddle - React, Tailwind, and code Playground

HTML

<div id="foo">
    <span>
        <a href="#" class="no-want">X</a>
        &nbsp;
        1
    </span>
    <span>
        <a href="#" class="no-want">X</a>
        &nbsp;
        2
    </span>
    <span>
        <a href="#" class="no-want">X</a>
        &nbsp;
        Hello
    </span>
</div> 
<div id='result'>
</div>

CSS

#result {
     border:1px solid blue;
}

JavaScript

var result = $("#foo span")
                 .contents()
                 .filter(function() {
                     return this.nodeType === 3;
                 }).map(function() {
                     return $(this).text().trim();
                 }).filter(function() {
                     return this != "";
                 }).toArray();
$("#result").text(result.join());