JSFiddle - React, Tailwind, and code Playground

by Town

HTML

<div id="test">
 this is a DIV
 <span>
  This is a span
 </span>
</div>

JavaScript

alert(document.getElementById('test').childNodes[0].nodeValue);