Extending the JavaScript DOM Interfaces
Found this great library of commonly used DOM traversal algorithms over at Ditchnet.org. The library contains such helpful functions as, hasClassName() and getFirstAncestorByClassName. The latter one has been added to the Element object so that it can be called on any element in an object oriented fashion. For example;
var node = target.getFirstAncestorByClassName('cName');
This library is definitely something worth looking at and maybe even adding to your collection. What really interests me about this library is how similar it is to my own library. I've written many of the same functions myself, with slight variations in the function names. Maybe that's just a sign that these functions should be a part of javascript to begin with.
Related posts: