How do I tell which element a jquery click occurred on?
Posted
by Colen
on Stack Overflow
See other posts from Stack Overflow
or by Colen
Published on 2010-05-03T00:55:42Z
Indexed on
2010/05/03
0:58 UTC
Read the original article
Hit count: 337
jQuery
|JavaScript
Hi,
I am handling a click on a list item with jquery:
$("#some_list li").click(function(event) {
// magic happens here
}
The list items look like:
<li><input type='checkbox'>Some text<span class='info'>(?)</span></li>
I want to have different behaviours depending on whether the user clicks within the (?), or anywhere else in the list. How can I detect which element the user clicked on?
© Stack Overflow or respective owner