Reputation: 7607
I have built an expandable, nested menu in <ul> <li> <ul> <li>
style in HTML. Both, the upper and lower <li>
s have an onCLick
attribute. when clicking on the lower (nested) li, the upper li should not trigger onClick
or at least submit to the handler, that it was activated indirectly.
How do I achieve this?
Upvotes: 0
Views: 92
Reputation:
I think this will help you:
$(document).ready(function(){
$(".header").click(function(){
$(this).children(".children").toggle();
});
$(".header a").click(function(e) {
e.stopPropagation();
});
});
If it dont: Send me a message
Upvotes: 1