Forums Register Login
Preventing event propagation
I have some code similar to the following. There is an onclick handler on a div element which contains an embedded anchor element. Clicking on the anchor element always seems to invoke the the div onclick handler. The desired action is to have the browser open the default email editor and return with div element onclick event invoked when a user clicks anywhere inside the div element EXCEPT for the anchor link. Is this possible? The application uses jQuery so I have access to that functionality if jQuery contains some way to achieve the desired action.

In the click handler you can examine the target of the event and let it propagate if it's an anchor, or do whatever else you want to do if it's not.
Thanks Bear! That's exactly what I needed to do.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 1065 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2018 02:03:55.