jQuery doesn't return the correct ID when I click
<p>I use PHP to display some results from the DB.</p>

<pre><code>while ($row = $stmt-&gt;fetch()) {
print "
   &lt;tr id = '".$row[0]."' class = 'fila'&gt;
         &lt;td&gt;&lt;input type='checkbox' name='checkboxx[]' value = '".$row[0]."'&lt;/td&gt;
         &lt;td&gt;".$row[1]."&lt;/td&gt;   
         &lt;td&gt;".$row[3]."&lt;/td&gt;
         &lt;td&gt;".$row[4]."&lt;/td&gt;
    &lt;/tr&gt;
";
}
</code></pre>

<p>With jQuery, I want to display the ID of each row (TR) if it's clicked.</p>

<p>I have this code.</p>

<pre><code>$(document).ready(function(){
    $(".fila").click(function(){
       var id = $('.fila').attr('id');
        alert(id);
    });
});
</code></pre>

<p><strong>Problem</strong>: It always displays the same ID when I click in different rows, when in fact, I look at source code, and each TR has its ID, which are different because they are selected from DB.</p>
