Append an element. Only element children change the list.
Length updates. No need to re-read box.children.
Careful in loops. If you add/remove while iterating, length changes under you — prefer a snapshot with Array.from when mutating.
Compatibility
Browser Support
Element.children is Baseline Widely available (MDN: across browsers since July 2015).
✓ Baseline · Widely available
Element.children
Supported in all modern browsers and long-standing engines. Safe for everyday DOM code.
99%Modern browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
Element.childrenExcellent
Bottom line: Universally available. Prefer children over childNodes when you only want element kids.
Frequently Asked Questions
It returns a live HTMLCollection of the element’s child elements only. Text nodes and comments are not included.
No. MDN marks Element.children as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
No. It is an HTMLCollection. It is array-like (length, [i], item(i)) but has no Array methods like map. Use for...of, or Array.from(el.children) when you need array helpers.
children includes only element nodes. childNodes includes every child node — elements, text, and comments. Whitespace between tags often appears in childNodes only.
Yes. If you append or remove element children, the same HTMLCollection updates automatically.
el.childElementCount equals el.children.length. Use the count when you only need the number; use children when you need the elements.