вот так
<!DOCTYPE HTML>
<html>
<head>
<style>
td{
width:50px;
height:50px;
border:1px solid black;
}
</style>
</head>
<body>
<table id='tb'>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td><a href='#'> 3</a></td></tr>
<tr><td>4</td></tr>
</table>
<script>
document.getElementById('tb').onclick = function (e){
var target = e&&e.target || event.srcElement;
if(target.tagName == 'TD'){
search(target)
} else if(target.tagName == 'A')alert('link');
return false;
}
function search(elem){
var tags = elem.getElementsByTagName('a');
if(tags.length)return;
alert('ссылок нет');
}
</script>
</body>
</html>