<p id="para-01">
<span>First span</span>
</p>Node: firstChild property / notebook
Node: firstChild property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const p01 = document.getElementById("para-01");
console.log(p01.firstChild.nodeName);<p id="para-01"><span>First span</span></p>const p01 = document.getElementById("para-01");
console.log(p01.firstChild.nodeName);