Web/API/Node/lastChild

From Get docs
< Web/API‎ | Node


The Node.lastChild read-only property returns the last child of the node. If its parent is an element, then the child is generally an element node, a text node, or a comment node. It returns null if there are no child elements.

Syntax

var childNode = node.lastChild;

Example

var tr = document.getElementById("row1");
var corner_td = tr.lastChild;

Specifications

Specification Status Comment
DOMThe definition of 'Node.lastChild' in that specification. Living Standard No change
Document Object Model (DOM) Level 3 Core SpecificationThe definition of 'Node.lastChild' in that specification. Obsolete No change
Document Object Model (DOM) Level 2 Core SpecificationThe definition of 'Node.lastChild' in that specification. Obsolete No change
Document Object Model (DOM) Level 1 SpecificationThe definition of 'Node.lastChild' in that specification. Obsolete Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
lastChild Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 1

IE

Full support Yes

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 45

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support