HTML:標記語言
CSS:樣式語言
JavaScript:指令碼語言
Web API:程式設計介面
所有 Web 技術
學習 Web 開發
發現我們的工具
更好地瞭解 MDN
此功能已成熟,可跨多種裝置和瀏覽器版本工作。它自 2018 年 4 月 起已在所有瀏覽器中可用。
Document.childElementCount 只讀屬性返回文件子元素的數量。
Document.childElementCount
要獲取特定元素的子元素數量,請參閱 Element.childElementCount。
Element.childElementCount
一個數字。
document.children; // HTMLCollection, usually containing an <html> element, the document's only child document.childElementCount; // 1
載入中…
DocumentFragment.childElementCount