traverse to parent td and tr from a item click in a cell
<p>I have a link ( anchor ) tag in a table cell on every row of an html table.
On click of this anchor tag I want to use jquery ( preferably) to traverse back to the parent td and tr and get object reference to it. </p>

<p>how can i use jquery at best here to navigate\traverse in dom.</p>

<p>I can do a method like this but not sure if jquery has better ways for this.</p>

<pre><code>function findRowNumber(element) 
{ 
  // element is a descendent of a tr element

  while(element.tagName.toLowerCase() != "tr") 
  {
   element = element.parentNode; // breaks if no "tr" in path to root
  }

  return element.rowIndex;
}
</code></pre>
