Please, could somebody help me?
I have divs and when clicking on a child div i would like to get just one onclick event, without that from the parent.
I checked on FF 2.0 and IE 6.0.
I have divs and when clicking on a child div i would like to get just one onclick event, without that from the parent.
I checked on FF 2.0 and IE 6.0.
Code:
<html>
<head>
<script type="text/javascript">
function stop(e) {
if (!e) e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
}
</script>
</head>
<body>
<div onmouseover="this.style.border='2px solid blue';this.style.background='#FDE9B9';stop(event);"
onMouseOut="this.style.border=''; this.style.background=''; "
onclick="alert('1');stop(event)">
bbb
<div onmouseover="this.style.border='2px solid blue';this.style.background='#FDE9B9';stop(event);"
onMouseOut="this.style.border=''; this.style.background=''; "
onclick="alert('2');stop(event)">
aaa<BR>ccc
</div>
</div>
</body>
</html>