et.js implements the W3C Recommendation Element Traversal, published on December 22, 2008, using general functions instead of attributes. If the W3C Recommendation is supported in your user agent, it takes advantage of it, otherwise it does it the old way using DOM Level 1 methods. It is intended for the Web developers who can't afford to assume that the Web supports Element Traversal or ECMAScript 3.1 getter/setter.
Add the following line inside the
HEAD element in your HTML page:
(Or better, save the resources of W3C and host your own copy of the file)
You can then use the following functions:
Element firstElementChild(myElement); Element lastElementChild(myElement); Element previousElementSibling(myElement); Element nextElementSibling(myElement); Number childElementCount(myElement);
$Date: 2008/12/23 21:58:44 $