Document: childElementCount property


目录

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.

Value

A number.

Examples

document.children;
// HTMLCollection, usually containing an <html> element, the document's only child

document.childElementCount;
// 1

Specifications

Browser compatibility

See also


版本号 #3
由 壳壳虫 创建于 2026-10-31 03:27:53 UTC
由 cocobook-sync 更新于 2026-11-04 17:33:36 UTC