Jquery iterate through the parent table on click of a link within a child td
<p>I have the following table structure</p>

<pre><code>&lt;table calss="ptable"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;select&gt;...&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&lt;input/&gt;&lt;/td&gt;
&lt;td&gt;input/&gt;&lt;/td&gt;
&lt;td&gt;&lt;a class="abc"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;select&gt;...&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&lt;input/&gt;&lt;/td&gt;
&lt;td&gt;input/&gt;&lt;/td&gt;
&lt;td&gt;&lt;a class="abc"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;select&gt;...&lt;/select&gt;&lt;/td&gt;
&lt;td&gt;&lt;input/&gt;&lt;/td&gt;
&lt;td&gt;input/&gt;&lt;/td&gt;
&lt;td&gt;&lt;a class="abc"&gt;&lt;/a&gt;&lt;/td&gt;    &lt;/tr&gt;&lt;/table&gt;
</code></pre>

<p>now on click of 'a' tag I have to iterate through the whole table and set vales for select and input within each td. I m Using jquery... Please help I m new to jquery....</p>

<p>I found solution for this like ....... </p>

<pre><code>  var firsta = $(".abc").first().parents(".ptable");              
  $(firsta).children("tbody").find("tr td").each(function (index) { alert(index); });
</code></pre>

<p>Is there a better way to achive this.</p>
