首頁
HTML / CSS
XML技術
Java技術
腳本語言
前端技術
框架
資料庫
高級語言
軟體測試
開發工具
大數據
其他技術
JavaScript 參考手冊
概覽
JavaScript
對象
JavaScript Array 對象
JavaScript Boolean 對象
JavaScript Date 對象
JavaScript Math 對象
JavaScript Number 對象
JavaScript String 對象
JavaScript RegExp 對象
JavaScript 全局屬性/函數
JavaScript 運算符
JavaScript Error
Browser
對象
Window 對象
Navigator 對象
Screen 對象
History 對象
Location 對象
存儲對象
DOM
對象
HTML DOM Document 對象
HTML DOM 元素對象
HTML DOM 屬性對象
HTML DOM 事件對象
HTML DOM Console 對象
CSSStyleDeclaration 對象
DOM HTMLCollection
HTML
對象
<a>
<area>
<audio>
<base>
<blockquote>
<body>
<button>
<canvas>
<col>
<colgroup>
<datalist>
<del>
<details>
<dialog>
<embed>
<fieldset>
<form>
<iframe>
<frameset >
<img>
<ins>
<input> - button
<input> - checkbox
<input> - color
<input> - date
<input> - datetime
<input> - datetime-local
<input> - email
<input> - file
<input> - hidden
<input> - image
<input> - month
<input> - number
<input> - range
<input> - password
<input> - radio
<input> - reset
<input> - search
<input> - submit
<input> - text
<input> - time
<input> - url
<input> - week
<keygen>
<link>
<label>
<legend>
<li>
<map>
<menu>
<menuItem>
<meta>
<meter>
<object>
<ol>
<optgroup>
<option>
<param>
<progress>
<q>
<script>
<select>
<source>
<style>
<table>
<td>
<th>
<tr>
<textarea>
<title>
<time>
<track>
<video>
HTML DOM
length
屬性
元素對象
實例
返回 body 元素子節點的的數目:
document.body.childNodes.length;
輸出結果:
8
定義和用法
length 屬性返回節點集合的數目。
節點對象的子節點集合是一個節點列表對象的實例。
流覽器支持
所有主要流覽器都支持 length 屬性
語法
nodelist
.length
技術細節
返回值:
返回數字,該數字代表了節點列表的節點數目。
DOM 版本
Core Level 1 Nodelist Object
元素對象
上一篇
HTML DOM 元素對象
下一篇
HTML DOM item() 方法