I have a situation that looks something like this
<div class="x" href="foo">
<div class="y" href="bar"></div>
<div class="z"></div>
<div class="y" href="baz"></div>
<a href="#">fooz</a>
</div>
x is a badge that should be clickable. The problem is that the badge also contains links that also should be clickable. In addition y and z are clickable. Unfortunately clicking the child links only leads to the outter x being pressed. How should I best handle something like this?
Continuing from my previous comment (assuming my understanding of your scenario was correct), here is your solution: http://jsfiddle.net/chricholson/7yzxQ/12/
It involves using stopPropagation to prevent the click being detected up the tree structure http://api.jquery.com/event.stopPropagation/