Question: Is it possible that I can assign a callback function for a right click while I disable the context menu?

[FIDDLE](http://jsfiddle.net/d6ca5wfh/)

```
$('div').on('contextmenu', function (e) {
    e.preventDefault();
    return false;
});

$('label').on('click', function (e) {
    var btn = e.button;
    if (btn == 2) {
        alert(1);
    } else {
        return false;
    }
});

```

Answer: 
this would be a much more convenient way to do it: **[DEMO](http://jsfiddle.net/d6ca5wfh/1/)** 

```
$('div').on('contextmenu', function (e) {
    if(!$(this).children('label').is(e.target)){
        e.preventDefault();
        return false;
    }
});

$('label').on('contextmenu', function (e) {
    alert(1);
    e.preventDefault();
    return false;
});

```
You're almost there. The `contextmenu` event fires when you right click. So in that handler, you should do what you want and then `e.preventDefault()`.

```
$('div').on('contextmenu', function (e) {
    var btn = e.button;
    if (btn == 2) {
        alert(1);
    } else {
        return false;
    }

    e.preventDefault();
    return false;
});

```