JSFiddle - React, Tailwind, and code Playground
HTML
<p><a>hello</a>there</p>
JavaScript
var p = document.getElementsByTagName("p")[0];
// example
alert(p.childNodes[1].textContent);
// or
alert(p.lastChild.textContent);
<p><a>hello</a>there</p>
var p = document.getElementsByTagName("p")[0];
// example
alert(p.childNodes[1].textContent);
// or
alert(p.lastChild.textContent);