jQuery click() event; how to prevent this event on right mouse btn click?

Posted by Kirzilla on Stack Overflow See other posts from Stack Overflow or by Kirzilla
Published on 2010-04-15T10:45:05Z Indexed on 2010/04/15 10:53 UTC
Read the original article Hit count: 103

Filed under:
|

Hello,

<img src="" width="200" height="200" id="test_img" />

<script>
 $("#test_img").click(function() {
   alert("Hello");
 });
</script>

But it doesn't matter what mouse button I'm pressing - right or left. I see absolutely the same result. I want alert to be shown only on left mouse button click.

Thank you and sorry; I'm little new to javascript.

Thank you.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript