This example cancels bubbling of the onclick event if it occurs in the IMG object when the user presses the SHIFT key. This prevents the event from bubbling up to the onclick event handler for the document.
Sample Code
<SCRIPT LANGUAGE="JScript">
function checkCancel()
{
if (window.event.shiftKey)
window.event.cancelBubble = true;
}
function showSrc()
{
if (window.event.srcElement.tagName == "IMG")
alert(window.event.srcElement.src);
}
</SCRIPT>