document.onclick = function (event) { event = event || window.event; var target = event.target || event.srcElement; if (target.tagName == "A") { alert("Ссылка!"); return false; } };