JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<span id="thisone">
The info I want
<span id="notthisone">
I don't want any of this nonsense
</span>
some other text node
</span>
JavaScript
var nodes = document.getElementById('thisone').childNodes;
var result = '';
for(var i = 0; i < nodes.length; i++) {
if(nodes[i].nodeType == 3) {
result += nodes[i].nodeValue;
}
}
alert(result);