$(function (){
$('#link').click(function (e){ e.stopPropagation(); /*do other thing*/});
})
Use the unbind http://api.jquery.com/unbind/
OnClick
event you can pass the current object type.
something like
onclick=foo(this)
The function foo looks like
function foo(obj) {
if(obj.tagName != 'A') {
alert('Yes')
}
}
Add a click handler to your link and stop event bubbleing to the parent div. Like this:
$('#link').click(function(e) {
e.stopPropagation();
});