The Document.childElementCount read-only property returns the number of child elements of the document.
Document.childElementCount
MDN Reference