How can I disable an element's context menu without disable the contextMenu for the entire document?
<p>I have this code to disable context menu on a <code>div</code></p>

<pre><code>    disableContextMenu = function (e){ 
        if(e.stopPropagation)
            e.stopPropagation();
        if(e.preventDefault)
            e.preventDefault();
        e.cancelBubble = true;
        return false;
    };
    clickedElement.oncontextmenu = disableContextMenu;
    if(clickedElement.addEventListener){
        clickedElement.addEventListener('contextmenu', disableContextMenu, false);
    }else if(clickedElement.attachEvent){
        clickedElement.attachEvent('oncontextmenu', disableContextMenu);
    }
</code></pre>

<p>This works as expect. But when I add a mouseup handler, the context menu comes up again.</p>

<pre><code>        clickedElement.onmousedown = function (e){
        if(e.which == 3){
            if(e.stopPropagation)
                e.stopPropagation();
            if(e.preventDefault)
                e.preventDefault();
            elementToShow.style.position = 'absolute';
            elementToShow.style.left = e.pageX + 'px';
            elementToShow.style.top = e.pageY + 'px';
            elementToShow.style.display = 'block';
            return false;
        }
    }
</code></pre>

<p>This does not work in my IE9. I used document instead and it works, but I don't want to disable the context menus for the textboxes and other elements. How can I do that?</p>

<p>Do not suggest me not to use this. It is a project for client and this is a requirement.</p>
