Tuesday, February 23, 2010

Programmer - jQuery how to execute event only on the inner element

Programmer Question

Is there is a smooth way to only let the inner element of a listitem
do something?
I read something here that using live complicates things.



Summation:



I have list elements that can contain a elements with a certain class.



The inner a elements are bound to a live click event handler.
The list items themselves have also a click event handler.



Something like this



<li>some text<a class="someClassName">some text</a></li>


with the handler for the a tags



$('#somelist li a').live("click", function(e)

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails