[jQuery] Selecting the lowest nested element on click??
Hey, All.
In the project I'm currently working on, I need to be able to select
the lowest nested element clicked. I couldn't quite figure out how to
phrase that, and it's still somewhat confusing how I did phrase it, so
here's an example. Say, for instance, that a page has a structure like
so:
<div id="1"><div id="2"><div id="3">Some Text</div></div></div>
Using the jQuery expression of
$("div").click(function() { alert("You Clicked A Div!") });
you would receive 3 alerts when you clicked on "Some Text," for in
doing so you would be triggering the 'click' event for #3 as well as
the two other div elements in which it is nested. So my question is
this: how would I go about triggering the 'click' event for the lowest
clicked nested element (i.e. #3 in my example structure)?
Thanks so much in advance! Your response could well salvage my
problem ;)
~Adam Bosco