So I have the following scenario:
Sample text. Anchor link
You can test which node was clicked with the target property of the event object:
$("#block").click(function(event) { if(event.target.nodeName != 'A') { alert('test'); } });
I suggest to read Event Properties from quirksmode.org.