I need to pass an element to a function and then match that specific element while traversing parent. The catch (for someone clueless like me) is that this element doesn\'t
Comparing JQuery objects will never return true, because each JQuery object is a a new object, even if their selectors are equal.
To compare elements, you have to check whether the DOM elements are equal:
this === element.get(0);