Jquery: detect if middle or right mouse button is clicked, if so, do this:

You may want to trap the mousedown event, and you also need to prevent the oncontextmenu event to stop the context menu from coming up during the right click event. $(“h2”).live(‘mousedown’, function(e) { if( (e.which == 1) ) { alert(“left button”); }if( (e.which == 3) ) { alert(“right button”); }else if( (e.which == 2) ) … Read more