Node.lastChild
lastChild
は Node
インターフェイスの読み取り専用プロパティで、このノードの最後の子ノードを返します。
親ノードが要素であった場合、子ノードはふつう、要素ノード、テキストノード、コメントノードの何れかです。
子要素がない場合は null
を返します。
Value
このノードの最後の子である Node
、または子ノードがなければ null
です。
例
const tr = document.getElementById("row1");
const corner_td = tr.lastChild;
仕様書
Specification |
---|
DOM Standard # ref-for-dom-node-lastchild① |
ブラウザーの互換性
BCD tables only load in the browser