Hi I have some checkboxes in table cells. I would like a click anywhere in the td to trigger the toggle of the checkbox.
I thought something like this would do it (obviously with more specific selectors for the real world) $("td").click(function(){ $(this).children("input").each(function(){ if (this.checked) { $(this).attr('checked',''); } else { $(this).attr('checked','true'); } }); }); this works for a click on the table cell, but stops the action of clicking on the checkbox itself from working - presumably because its running the above plus the standard HTML toggle, and therefore canceling itself out. Any ideas ?