<ul id="list">
<li>First (1)</li>
<li>Second (2)</li>
<li>Third (3)</li>
</ul>Element: firstElementChild property / notebook
Element: firstElementChild property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const list = document.getElementById("list");
console.log(list.firstElementChild.textContent);
// logs "First (1)"