[javascript] Is right click a Javascript event?

have a look at the following jQuery code:

$("#myId").mousedown(function(ev){
      if(ev.which == 3)
      {
            alert("Right mouse button clicked on element with id myId");
      }
});

The value of which will be:

  • 1 for the left button
  • 2 for the middle button
  • 3 for the right button