Is it possible to disable the jquery click when a href link (inside the clickable div) was clicked?
HTML
<div id="test">
<a href="http://google.de">google</a>
</div>
JS
$(document).ready(function()
{
$('#test').click(function() {
alert('the link was not clicked');
});
});
example
http://jsfiddle.net/QHQcQ/2/
I’m not sure what you want, but adding –
would prevent the link click from firing and also stop the link click bubbling up to the ‘div’ click event.
Demo – http://jsfiddle.net/ipr101/Lf3hL/