Tinybits is a collection of unrelated, small scripts and snippets which make the life of a programmer somewhat easier.

DOM 2 Traversal in Javascript

There is an optional DOM feature called Traversal. Its specification can be found on the W3C site. Last time I battled certain DHTML code, I was quite frustrated by the fact that none of the user agents known to me support this feature. Well, here it is, implemented in Javascript.

In order to use it, first check whether your user agent supports it natively. To do that, have your user agent's Javascript engine execute the following:

document.implementation.hasFeature("Traversal", 2.0);

If it returns true, then your user agent supports DOM 2 Traversal natively and you won't need this implementation. If it throws an exception or returns false, then you can download the dom2traversal.js file and see if it can help you.


These things is so small and simple that you shouldn't need any support with it. If you have something you cannot keep, I'll be hearing. See the contact information for info about the means that I have for receiving inquiries.


All Tinybits are free. They are distributed under the terms of the zlatkovic.com Public Licence which you can read here. The terms of use for this website may be of interest too.

DOM 2 Traversal in Javascript
All Tinybits (HTTP)
All Tinybits (FTP)
© 2000-2007 Igor Zlatković. All rights reserved. Last modification: Mon, 10 Sep 2007 21:12:33 GMT+02:00
Comments? Questions? Please tell us about it.