[jQuery] Re: Checkbox confusion

2008-05-12 Thread Chris Cotton
Wow!! that worked!!! thanks Next question. . .Why? I am not seeing the flaw in the logic of my broken and obviously less elegant solution. And how did you get away with not having to use event.preventDefault() ??? Also i don't understand why var item = $(this).parent().text(); returns what

[jQuery] Re: Checkbox confusion

2008-05-12 Thread Wizzud
Firstly, you were placing a click handler on the LI, not on the INPUT (the checkbox), so inside the click handler 'this' refers to the relevant LI whose checkbox has been clicked. That's fine for retrieving the text, but the LI doesn't know whether the checkbox is checked or not (as a result of

[jQuery] Re: Checkbox confusion

2008-05-08 Thread Wizzud
Try this... $(#bChecklist input:checkbox).click(function(event){ var item = $(this).parent().text(); alert ( (this.checked ? '' : 'Un') + 'Checked = ' + item); }); On May 8, 1:38 am, mr4d [EMAIL PROTECTED] wrote: Hi all, Can't quite get the the following functionality to