Find which mouse button clicked using jQuery

For one of my requirement, I need to determine which mouse button (Left, Middle or Right) was clicked. jQuery provides mousedown() event, using which we can check which mouse button is clicked. For key or button events, event attribute indicates the specific button or key that was pressed. event.which will give 1, 2 or 3 for left, middle and right mouse buttons respectively. The advantage of using event.which is that it eliminates cross browser compatibility.
$(document).ready(function() {
    switch (event.which) {
        case 1:
            alert('Left mouse button pressed');
        case 2:
            alert('Middle mouse button pressed');
        case 3:
            alert('Right mouse button pressed');
See live Demo and Code.
Feel free to contact me for any help related to jQuery, I will gladly help you.

Nothing shocks me, I'm a Software Engineer. And I am not young enough to know everything. I live in World Wide Web and from there take care of this website. This website communicates about my work, learning and experience. I believe life is short, and it is for loving, sharing, learning and connecting. So lets connect..