<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<a href="http://google.com">google</a>
<a href="http://yandex.ru">yandex</a>
<script>
document.onclick = function(event) {
var target = (event && event.target) || window.event.srcElement;
if (target instanceof HTMLAnchorElement) {
alert(target.href);
return false;
}
};
</script>
</body>
</html>