I need to skip something very important, I used .parent (). parent (). parent () .. etc to traverse the DOM and .next (). next () to traverse the DOM.
I know that this is wrong, and that I need something more reliable, I need a selector that will move from the clicked element of $ (this) down the DOM to see if the element was pressed inside the element with the class "last" .
div.last > div > table > tr > td > a[THE ITEM CLICKED is in the element last]
and
div > div > table > tr > td > a[THE ITEM CLICKED is not in the element last]
then if the result has a length
var isWithinLastRow = [amazingSelector].length;
do something else in this case.
Iamsamstimpson
source share