JSFiddle - React, Tailwind, and code Playground

by Michel Plungjan

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);