JSFiddle - React, Tailwind, and code Playground

HTML

<div>click me</div>

JavaScript

$('div').mousedown(function(event) {
    switch (event.which) {
        case 1:
            alert('Mouse left click');
            break;
        case 2:
            alert('Mouse middle click');
            break;
        case 3:
            alert('Mouse right click');
            break;
        default:
            alert('Do something else');
    }
});