I have an A tag which triggers the animation of it\'s great-great-great-grandparent. All of the following will work, but which is most efficient, and why?
$
Here’s an analyzation:
.foo..foo.So I would choose the last one, closest(".foo"). The reason:
parent, because if your document changes because you removed or added one hierarchy, you don’t need to change the jQuery code.parents(".foo"), because it stops as soon as a match has been found.