Table of contents
- 1. Summary
- 2. Syntax and Values
- 3. Example
- 4. Notes
- 5. Specification
Summary
lastChild returns the last child of a node.
Syntax and Values
var last_child = element.lastChild;
The last_child returned is a node. If its parent is an element, then the child is generally an Element node, a Text node, or a Comment node.
Example
var tr = document.getElementById("row1");
corner_td = tr.lastChild;
Notes
Returns null if there are no child elements.


Mozilla Developer Network