Overview / Web Technology
Web technology reference for developers
HTML
Structure of content on the web
CSS
Code used to describe document style
JavaScript
General-purpose scripting language
HTTP
Protocol for transmitting web resources
Web APIs
Interfaces for building web applications
Web Extensions
Developing extensions for web browsers
Accessibility
Build web projects usable for all
Web Technology
Web technology reference for developers
Filter sidebar
In this articleDocument
activeElement
adoptedStyleSheets
alinkColor
Deprecatedall
Deprecatedanchors
Deprecatedapplets
DeprecatedbgColor
Deprecatedbody
characterSet
childElementCount
children
compatMode
contentType
cookie
currentScript
defaultView
designMode
dir
doctype
documentElement
documentURI
domain
Deprecatedembeds
featurePolicy
ExperimentalfgColor
DeprecatedfirstElementChild
fonts
forms
fragmentDirective
fullscreen
DeprecatedfullscreenElement
fullscreenEnabled
head
hidden
images
implementation
lastElementChild
lastModified
lastStyleSheetSet
Non-standard DeprecatedlinkColor
Deprecatedlinks
location
pictureInPictureElement
pictureInPictureEnabled
plugins
pointerLockElement
preferredStyleSheetSet
Non-standard Deprecatedprerendering
ExperimentalreadyState
referrer
rootElement
Deprecatedscripts
scrollingElement
selectedStyleSheetSet
Non-standard DeprecatedstyleSheets
styleSheetSets
Non-standard Deprecatedtimeline
title
URL
visibilityState
vlinkColor
DeprecatedxmlEncoding
DeprecatedxmlVersion
DeprecatedadoptNode()
append()
browsingTopics()
Experimental Non-standardcaretPositionFromPoint()
caretRangeFromPoint()
Non-standardclear()
Deprecatedclose()
createAttribute()
createAttributeNS()
createCDATASection()
createComment()
createDocumentFragment()
createElement()
createElementNS()
createEvent()
DeprecatedcreateExpression()
createNodeIterator()
createNSResolver()
DeprecatedcreateProcessingInstruction()
createRange()
createTextNode()
createTouch()
Non-standard DeprecatedcreateTouchList()
Non-standard DeprecatedcreateTreeWalker()
elementFromPoint()
elementsFromPoint()
enableStyleSheetsForSet()
Non-standard Deprecatedevaluate()
execCommand()
DeprecatedexitFullscreen()
exitPictureInPicture()
exitPointerLock()
getAnimations()
getElementById()
getElementsByClassName()
getElementsByName()
getElementsByTagName()
getElementsByTagNameNS()
getSelection()
hasFocus()
hasStorageAccess()
hasUnpartitionedCookieAccess()
importNode()
moveBefore()
ExperimentalmozSetImageElement()
Non-standardopen()
prepend()
queryCommandEnabled()
Non-standard DeprecatedqueryCommandState()
Non-standard DeprecatedqueryCommandSupported()
Non-standard DeprecatedquerySelector()
querySelectorAll()
releaseCapture()
Non-standardreplaceChildren()
requestStorageAccess()
requestStorageAccessFor()
ExperimentalstartViewTransition()
write()
Deprecatedwriteln()
Deprecatedafterscriptexecute
Non-standard Deprecatedbeforescriptexecute
Non-standard DeprecatedDOMContentLoaded
fullscreenchange
fullscreenerror
pointerlockchange
pointerlockerror
prerenderingchange
Experimentalreadystatechange
scroll
scrollend
scrollsnapchange
Experimentalscrollsnapchanging
Experimentalsecuritypolicyviolation
selectionchange
visibilitychange
AbortController
AbortSignal
AbstractRange
Attr
CDATASection
CharacterData
Comment
CustomEvent
DOMError
DeprecatedDOMException
DOMImplementation
DOMParser
DOMPoint
DOMPointReadOnly
DOMRect
DOMTokenList
DocumentFragment
DocumentType
Element
Event
EventTarget
HTMLCollection
MutationObserver
MutationRecord
NamedNodeMap
Node
NodeIterator
NodeList
ProcessingInstruction
Range
StaticRange
Text
TextDecoder
TextEncoder
TimeRanges
TreeWalker
XMLDocument
Baseline Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since April 2018.
The Document.childElementCount
read-only property returns the number of child elements of the document.
To get the number of children of a specific element, see Element.childElementCount
.
A number.
Examplesjs
document.children;
// HTMLCollection, usually containing an <html> element, the document's only child
document.childElementCount;
// 1
Specifications Specification DOM .
This page was last modified on Apr 7, 2023 by MDN contributors.
View this page on GitHubâ¢
Report a problem with this contentRetroSearch 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