Interface ElementTraversal

public interface ElementTraversal

The ElementTraversal interface is a set of properties on the
Element object, which allow an author to easily navigate
between elements.

Note: This interface has not yet been accepted for
inclusion in the W3C DOM 3 specification. It may be removed from the
JSR 280 specification or added to a different namespace in a
subsequent version of the specification.

Four of the properties, firstElementChild,
lastElementChild, previousElementSibling, and
nextElementSibling, each provide a live reference to another
element with the defined relationship to the current element, if the related
element exists. The fifth property, childElementCount, exposes
the number of child elements of an element, for preprocessing before
navigation. A conforming implementation must implement all five methods. An
implementation may implement similar interfaces in other specifications, but
such implementation is not required for conformance to this specification,
if the implementation is designed for a minimal code footprint.

This interface must be implemented on all elements, regardless of their
namespace. For the purpose of ElementTraversal, an entity reference node
which represents an element must be treated as an element node. Navigation
must be irrespective of namespace, e.g. if an element in the HTML namespace
is followed by element in the SVG namespace, nextElementSibling
will allow you to navigate from the HTML element to the SVG element.

Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.

A script enabled browser is required for this page to function properly.A script enabled browser is required for this page to function properly.A script enabled browser is required for this page to function properly.