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
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
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
3 matches
Mail list logo