I am working in a browser extension. I am putting some icons next to links in google search pages. These icons trigger some actions and I need stop bubble events after user clicks on it. In resume, parent div tags must not know about clicks on these icons.
Next code allow stop bubbling events in all browsers:
if (event.cancelBubble) {
event.cancelBubble = true;
}
if (event.returnValue) {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
}
if (event.preventDefault) {
event.preventDefault();
}
In Firefox works well but in this context not works in IE (version 8 at least). Any idea about it?