Link to home
Start Free TrialLog in
Avatar of ShanghaiD
ShanghaiDFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Ignore span.click() inside td.click()

I currently have a function acting on a td.click() as follows:

$('#tsTable').on('click', 'table tbody tr td:nth-child(2)', function(e) {

// other code here

});

I also have a span inside this td which has its own click function:

$('#tsTable').on('click', 'span.tag', function(e) {

// other code here

});

How do I stop the td.click function from triggering when I click the span.tag which is inside the td?  I only want the td.click function to trigger if the td is clicked outside the span.tag.

Hope this makes sense.
ASKER CERTIFIED SOLUTION
Avatar of Khilu
Khilu
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial