Document: lastElementChild プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Document.lastElementChild
は読み取り専用プロパティで、この文書の最後の子要素 (Element
)、または子要素がない場合は null
を返します。
HTML 文書では、これは通常唯一の子要素であるルート <html>
要素です。
文書内の固有の要素の最後の子要素については Element.lastElementChild
を参照してください。
値
ルート <html>
要素です。
例
js
document.lastElementChild;
// 文書のただ一つの子であるルート <html> 要素を返す
仕様書
Specification |
---|
DOM # ref-for-dom-parentnode-lastelementchild① |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
lastElementChild |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.