Table Row Clicking + Checking a Checkbox
I'm having a problem with the code below. Everything works fine but when I click the checkbox in the table row, it doesn't change its state since it seems to be doing it twice. My goal is to be able to click anywhere in the table row to checkmark it, and then clicking the checkbox will also change its state (not run it twice). Can someone help?
$("#tables_DLC tr").mouseover(function() {
$(this).addClass("over");}).mouseout(function() {
$(this).removeClass("over");
}).click(function(){
var id = this.id.split("_");
var song_id = id[1];
$("#song_" + song_id + " :checkbox").each ( function() {
this.checked = !this.checked;
});;
return false;
});
$("#tables_DLC :checkbox").click( function(){
// Try setting the TR onclick to nothing
this.parents('tr').click(function(){});
return false;
});