Avoid multiple parent traversing iterations in jQuery

102 Views Asked by At

I am trying to access great grand parent of currently selected tab.

I know it can be done with $(tabSelected).parent().parent().parent()... and so on.

But how to avoid that kind of multiple and repetitive parent traversing iteration and get the great grand parent in one go ?

Need a generalised function/selector for this.

0

There are 0 best solutions below