jquery checkbox click
<p>have a table </p>

<pre><code>&lt;table&gt;
  &lt;tr class="c1"&gt;&lt;td&gt;&lt;input type="checkbox" name="tableRow[]"&gt;&lt;/td&gt;......&lt;/tr&gt;
  &lt;tr class="c2"&gt;&lt;td&gt;&lt;input type="checkbox" name="tableRow[]"&gt;&lt;/td&gt;......&lt;/tr&gt;
  &lt;tr class="c1"&gt;&lt;td&gt;&lt;input type="checkbox" name="tableRow[]"&gt;&lt;/td&gt;......&lt;/tr&gt;
...
&lt;/table&gt;
</code></pre>

<p>and then the js is:</p>

<pre><code>$('input:checkbox[name*=tableRow]').click(function(event) {

    var el = $(this);
    if (el.attr('checked')) {
        el.parents('tr').css("background-color", '#ffcccc');
    }
    else {
        el.parents('tr').css("background-color", 'inherit');
    }
    event.stopPropagation();
});

$('input:checkbox[name*=tableRow]').parents('tr').click(function() {
    var el = $(this).find('&gt; td:eq(0) &gt; :checkbox');
    el.click();
});​
</code></pre>

<p>checkbox checks and unchecks in both ways, but when i click "tr" it looks like event rans before check set.</p>

<p>need: in both ckecks then set css</p>
