how to determine which Mouse Button was pressed

Answer Posted / prashant ramkishan muttepawar

syntax :: alert("You pressed button: " + event.button)

Return Value ::A Number, representing which mouse button that was pressed when the mouse event occured.

Possible values:
0 : Left mouse button
1 : Wheel button or middle button (if present)
2 : Right mouse button
Note: Internet Explorer 8 and earlier has different return values:

1 : Left mouse button
2 : Right mouse button
4 : Wheel button or middle button (if present)
Note: For a left-hand configured mouse, the return values are reversed

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to pass data between pages using Cookies

1842


how to create an anonymous function

1723


Create a ViewState Property?

2279


Reading which Non-Character Key was pressed

1681


How to block double clicks

1620






code to detect availability of cookies

1778


how to create Expandable and Collapsible Menus

2652


how to create a Draggable element

1966


code to set the main window's size

1701


how to pass data between pages using Frames

2142


program to bring a window to the front

1558


communication between main window and new windows

1697


code to create a new window

1752


Code to Block submission of form by pressing Enter Key

2062


code to images to rollover

1853