I have to get a far parent’s child’s child’s attribute href…
now i can get that using this long statement
var uid = $(this).parents(':eq(7)').children( ).find('.p_cell')
.children(':eq(0)').children(':eq(0)').attr('href');
please any string using ‘>’ and ‘ : ‘ that can simplify the statement
thanks
Pradyut
India
Without knowing the HTML, you can use
:first-childlike this:If that parent has a class you can access though, instead of say the 8th parent you could find it via a selector that matched using
.closest(). For example if that parent was a<div>like this:You could do this:
However, if you posted the HTML this can likely get much simpler.