hi,
in MSIE, you can attach onclick event to both anchor and document objects.
here is some code :
document.onclick = function() {alert('document clicked ...'); }
<a href= " " onclick="clickHandler"></a>
function clickHandler(){
alert('anchor clicked ... ');
}
now, its supposed that if I clicked the anchor, both clickHandler, and document onclick handler will be called, this is what is called event bubbling .
now if rewrite the clickHandler as :
function clickHandler(){
event.cancelBubble = true ;
alert('anchor cliked ... ');
}
now, the document onclick handler is not called, since the anchor onclick handler stopped the bubbling of the event.
guys, is there anyway for document onclick handler to be invoked, even that anchor onclick event handler stopped the event bubbling !!!
thanks .