Firefox Tomorrow

web api instance property

DocumentFragment: lastElementChild property

View on MDN ↗

The DocumentFragment.lastElementChild read-only property returns the document fragment’s last child Element, or null if there are no child elements.

Value

An Element that is the last child Element of the object, or null if there are none.

Examples

let fragment = new DocumentFragment();
fragment.lastElementChild; // null

let paragraph = document.createElement("p");
fragment.appendChild(paragraph);

fragment.lastElementChild; // <p>

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also