Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Node lastChild Property

HTML DOM lastChild Property

Element Object Reference Element object

Example

Return the last child node of the document:

document.getElementById("myList").lastChild;

Try it »


Definition and Usage

The lastChild property returns the last child node of the document.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the lastChild property


Syntax

node

.lastChild

Technical Details

Return Value: The last child node
DOM version Core Level 1 Node Object

Element Object Reference Element object