Q:

click on div element inside an  tag

I have a set of div elements inside <a> tag with it's href.
The question is that there is a div inside of it with its own click event and I want that in case the div element trigger the click event, the <a> tag should not be triggered.
The function that manage the div click event try to stop propagation with no success.
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();

What's wrong?

A:

If you're using jQuery to attach to the event, then do
e.preventDefault();

JQuery normalizes the event object so this method is available on all browsers (otherwise older IE's don't have it).
Here's the documentation for preventDefault().
If that doesn't help, then try attaching a click handler on the <a> itself and call preventDefault() from that.

