Sample code:
<div id="a">
<div id="b">
Click here
</div>
</div>
<script>
$('*').click(function() {
alert($(this).attr('id'));
});
</script>
When you click ‘Click Here’ it alerts twice, once with ‘b‘ and then with ‘a‘.
I need to figure out how to get jQuery to ignore all the parents of where the user clicked and just alert, in this case, ‘b’.
Try using
$('body').delegate('*', 'click', fn)instead of direct event handlers. (See jQuery.delegate.) It will be called exactly once for each event, and you can find out from the event object which element was affected.