Можно и так
<div id="myDiv">
<a href="http://www.example.com">www.javascript.ru</a><br>
<a href="http://www.javascript.ru">www.javascript.ru</a>
</div>
<script>
window.onload = function () {
var myDiv = document.getElementById('myDiv');
myDiv.onclick = function (e) {//onclick begin
e = e || window.event;
var target = e.target || e.srcElement;
if (target.parentNode == myDiv) {
if (target.href == 'http://www.javascript.ru/') {
alert('true link:\n' + target.href);
} else {
alert('false link:\n ' + target.href);
return false;
}
}
}//onclick end
}
</script>