> Thank you John, that helps (but a little slower than my own impl).

I'd imagine so. It's virtually impossible to get the elements that you
desire without taking more code to write it. Considering that the
optimal implementation can make so many shortcuts:

function getFirst(type) {
    var cur = this.parentNode;
    while ( cur != document.documentElement ) {
        if ( cur.nodeName == type )
            return cur;
        cur = cur.parentNode;
    }
}

The phrase "a little bit slower" is probably a safe way to describe
any JavaScript library or framework, since they all have to make
concessions to some degree.

--John

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to