Issue with odd and even rows with jquery
<p>I have situation where I have structure like:</p>

<pre><code>&lt;table&gt;
&lt;tr class="chk"&gt;&lt;/tr&gt;
&lt;tr&gt;one&lt;tr&gt;
&lt;tr&gt;two&lt;tr&gt;
&lt;tr&gt;three&lt;tr&gt;
&lt;tr&gt;four&lt;tr&gt;
&lt;tr class="chk"&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;table&gt;
&lt;tr class="chk"&gt;&lt;/tr&gt;
&lt;tr&gt;one&lt;tr&gt;
&lt;tr&gt;two&lt;tr&gt;
&lt;tr&gt;three&lt;tr&gt;
&lt;tr&gt;four&lt;tr&gt;
&lt;tr class="chk"&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Now what I want to do is to do something when tr chk is clicked.
What I am doing right now is: </p>

<pre><code>$(".chk:even").click(function(){
    //do something
});


$(".chk:odd").click(function(){
    //do something
});
</code></pre>

<p><strong>Note:</strong> The above <strong>is working</strong> as I want.</p>

<p>I was wondering how I can determine if row is even or odd in a single function like:</p>

<pre><code>$(".chk").click(function(){
  if(row is even){
     //do something
   }
  else{
    //do something
  }
});
</code></pre>

<p>Or is what I already have better or fine than the new version I am seeking?</p>

<p>Let me know if question is not clear.</p>
