.firstElementChild
Element? ParentNode.firstElementChild
A property containing the first element child of a node - it does not count text nodes. Returns null if no element child nodes are found. This property is read-only - it cannot be set.
let firstEl = node.firstElementChild;See also: .lastElementChild
Example
HTML:
<p>
All
<strong>large</strong>
goats
<em>are</em>
delicious!
</p>JavaScript:
let first = document.query("p").firstElementChild;Result is the <strong>large</strong> element.