diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/node/lastchild/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/node/lastchild/index.html')
-rw-r--r-- | files/zh-cn/web/api/node/lastchild/index.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/node/lastchild/index.html b/files/zh-cn/web/api/node/lastchild/index.html new file mode 100644 index 0000000000..72e9d6b1c5 --- /dev/null +++ b/files/zh-cn/web/api/node/lastchild/index.html @@ -0,0 +1,21 @@ +--- +title: Node.lastChild +slug: Web/API/Node/lastChild +tags: + - Property +translation_of: Web/API/Node/lastChild +--- +<p>{{APIRef()}}</p> +<h2 id="Summary" name="Summary">概述</h2> +<p><code><strong>Node.lastChild</strong></code> 是一个只读属性,返回当前节点的最后一个子节点。如果父节点为一个元素节点,则子节点通常为一个元素节点,或一个文本节点,或一个注释节点。如果没有子节点,则返回 <code>null</code>。</p> +<h2 id="语法">语法</h2> +<pre class="syntaxbox">var last_child = element.lastChild</pre> +<h2 id="Example" name="Example">示例</h2> +<pre class="brush: js">var tr = document.getElementById("row1"); +var corner_td = tr.lastChild; +</pre> +<h2 id="Specification" name="Specification">规范</h2> +<ul> + <li>{{Spec("http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-61AD09FB", "DOM Level 2: lastChild", "REC")}}</li> + <li>{{Spec("http://dom.spec.whatwg.org/#dom-node-lastchild", "DOM Standard: lastChild")}}</li> +</ul> |