If  performance  is  the  goal  (though what is the actual performance
target per call, and with what baseline DOM structure?) something that
can wrap qSA should be faster.

function parentWithClassById(id) {
    if ($$('.theclass #'+id).length)
        return true;
    else
        return false;
}

This  tests  at  50% faster than the reverse combinator and 75% faster
than getParent().

-- S.

Reply via email to