I have a table with checkboxes. When a checkbox is checked I catch the event with jQuery but this checkbox is immediately unchecked.
The jsfiddle: http://jsfiddle.net/K4uDa
<table>
<tr>
<td><input type='checkbox' /></td><td>AA</td>
</tr>
<tr>
<td><input type='checkbox' /></td><td>BB</td>
</tr>
<tr>
<td><input type='checkbox' /></td><td>CC</td>
</tr>
</table>
$(function() {
$("table tr").live("click", function() {
alert('row clicked');
});
$("table tr td input:checkbox").live("click", function() {
alert('checked/unchecked');
return false;
});
})
Where is the problem?
Sorry, I updated my jsfiddle here: http://jsfiddle.net/K4uDa/1/
I added a 'return false' because I don't want the other event to fire when a checkbox is checked/unchecked.