document.onclick = function (event) { event = event || window.event; var target = event.target || event.srcElement; if (target.tagName.toUpperCase() == "A") { event.preventDefault(); alert(target.href); } };
event.preventDefault ? event.preventDefault() : (event.returnValue = false);