Baseline Widely available
The Document.firstElementChild
read-only property returns the document's first child Element
, or null
if there are no child elements.
For HTML documents, this is usually the only child, the root <html>
element.
See Element.firstElementChild
for the first child element of specific elements within a document.
A Element
object, or null
.
document.firstElementChild;
// returns the root <html> element, the only child of the document
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4