Latest Version: 3.0 RC 1 17 July 2017

Method _.Node.last

Similar to Element.lastChild, this finds the last child node that matches the passed mask, or the first Element node if a mask is omitted.

The reason to do this instead of lastChild is that first, you can match by tagName. Second, there are other types of nodes that can end up on the DOM beside element... such as text nodes, comment nodes, etc.

Calling Convention:
_.Node.last(Element[, nodeMask || tagName])
The Element to find the last matching node inside of.
nodeMask optional

A bitwise mask used to filter the results. See the Node Masking page for more information.

If omitted, a mask of 1 (matching for nodeType 1) is used.

tagName optional
A tagName to match. When used instead of a nodeMask only elements of node type 1 with a matching tagName will be counted.
The matching element, or false if no match found.



<ul id="test">


var test = document.getElementById('test');

Will output "Third"