Peter Gordon schreef:
> This is the code when the item is clicked.
>
> $("li").bind("click", function(){
> alert( $(this).text() ); event.stopPropagation();
> });
>
> The problem is that when I click on a leaf, not only do I get an event
> for that leaf, but I get an event for each parent.
>
> How can I stop the propogation. I tried event.stopPropagation(), but it
> doesn't seem to do anything.
>
The event variable is an argument of your function. This should work:
$("li").bind("click", function(evt){
alert( $(this).text() );
evt.stopPropagation();
});
Edwin Martin
--
http://www.bitstorm.org/edwin/en/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/