I have a list of checkboxes inside a table with a simple jQuery function that allows the user to click anywhere in the table row to check / uncheck the box. It works great, unless the user clicks on this checkbox. Then it does not work. Any ideas? Here is my code:
HTML:
<tr onClick="checkBox()">...</tr>
JQuery
function checkBox() { var ischecked = $('input#myContacts').attr("checked"); if(ischecked) { $('input#myContacts').attr("checked", false); } else { $('input#myContacts').attr("checked", true); } return false; }
source share