Something like this might help:

$('table tr').click(function(e){
if( $(e.target).is('td') ){
$('input:checkbox', this).attr('checked', 'checked');
}
});

----
Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com



On Fri, Feb 6, 2009 at 7:40 AM, Sam Hastings <sam.hasti...@gmail.com> wrote:
>
> Hi everyone,
>
> I've got an HTML table like this:
>
> <table>
>        <tr>
>                <td>Foo</td>
>                <td>Bar</td>
>                <td>Baz</td>
>                <td><input type="checkbox" /></td>
>        </tr>
> </table>
>
> What I'd like to do is toggle the checkbox's checked state when any of
> the cells in its row are clicked. I've tried this a thousand different
> ways and can't get it working and was wondering if someone here would
> be kind enough to help.
>
> Many thanks :-)
>
> Sam Hastings

Reply via email to