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
Post a Comment