element.lastChild
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.
요약
lastChild는 노드의 마지막 자식을 반환합니다.
구문과 값
js
last_child = element.lastChild;
반환되는 last_child
는 노드입니다. 노드의 부모가 요소이면, 자식은 보통 요소 노드, 텍스트 노드, 주석 노드입니다.
예시
js
var tr = document.getElementById("row1");
corner_td = tr.lastChild;
주의
자식 요소가 없으면 null
을 반환합니다.
명세
Specification |
---|
DOM # ref-for-dom-node-lastchild① |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
lastChild |
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.