klev2004,
<style>
#id1{
background-color: yellow;
width: 100%;
height: 30px;
}
</style>
<div id="id1">
<a href="#" id="id2">link</a>
</div>
<script>
window.onload = function () {
document.getElementById("id1").onclick = function (e) {
e = e || event;
target = e.target || e.srcElement;
if (target.tagName == "A") { alert("линк"); }
else { if (target.id == "id1") { alert("div"); } }
}
}
</script>