Visit Mozilla.org

DOM:element.lastChild

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

lastChild returns the last child of a node.

[edit] Syntax and Values

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.

[edit] Example

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

[edit] Notes

Returns null if there are no child elements.

[edit] Specification

lastChild