title: jQuery - how to filter a table row
body: <p>I have a need to filter a certain table row by clicking a link.</p>
  
  <pre><code>function filterRows(statusName) {
           $("#mainTable &gt; tbody &gt; tr").find(statusName).each( function () {
               alert($(this));
               //the alert is not shown
  
           });
       }
  
  &lt;a class="rejected" href="#" onclick="filterRows('rejected');"&gt;rejected&lt;/a&gt;
  &lt;a class="new" href="#" onclick="filterRows('new');"&gt;new&lt;/a&gt;
  
  &lt;table id="mainTable"&gt;
    &lt;thead&gt;
     &lt;tr&gt;
       &lt;td&gt;col1&lt;/td&gt;
       &lt;td&gt;col2&lt;/td&gt;
     &lt;/tr&gt;
   &lt;/thead&gt;
   &lt;tbody class="Content"&gt;
    &lt;tr class="rejected"&gt;
      &lt;td&gt;data1&lt;/td&gt;
      &lt;td&gt;data12&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;data13&lt;/td&gt;
      &lt;td&gt;data15&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr  class="new"&gt;
      &lt;td&gt;data16&lt;/td&gt;
      &lt;td&gt;data18&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p></p>
  
  <p>But it's not working even <code>alert($(this))</code> doesn't. Any suggestions?</p>