Table of contents

  1. 1. Summary
  2. 2. Syntax and Values
  3. 3. Example
  4. 4. Notes
  5. 5. Specification

« Gecko DOM Reference

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.

Specification

lastChild

Tags (3)

Edit tags

Attachments (0)

 

Attach file