Try the following code: $('.myrow').children().click(function() { if ($(this).children('[EMAIL PROTECTED]').length == 0) {
var check_id = '#' + $(this).parent().attr('id') + 'checkbox'; $(check_id).attr('checked', !$(check_id).attr('checked')); } }); On Sep 8, 8:55 am, "Michael Smith" <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm trying to make a page which automatically toggles a checkbox when > you click anywhere on the row. > > Here's a version I've cut down to the bare bones to illustrate > > http://dev.savingforchildren.co.uk/mjs/row_select.epl > > It seems to work fine unless the user actually clicks on the checkbox > itself. In this case it seems that it actually gets toggled twice and > so reverts to its original state. > > Any suggestions on the cleanest / simples way to avoid this? (I can > think of a few messy ways) > > Thanks > > Michael