javascript - Short hand for .parent().parent().parent() -


i have jquery function, needs position of element's parent.

it looks like:

   function show(e) {         //debugger;            var nexttableselector = $(e).parent().parent().parent().parent().parent().parent().parent().parent();   } 

is there short hand traversing dom structure?

something along lines of:

$(e).parent()[5]; 

any suggestion?

note dom structure generated 3rd party js framework, , i'm not able append additional id's or classes structure. i'm stuck having work way through dom way.

if can't identify exclusively element want know fifth parent up, can $(e).parents().eq(5) or $(e).parents()[5] suggested.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -