click here to test click hear to clear |
Browser Mouse Event Test PageThis page contains a script for testing the events fired in different browsers when a mouse click occurs. My interest in this page is what events occur when a mouse click or double click takes place, and how different mouse buttons are identified.Some results from some browsers are included in the tables below, though this is not meant to be comprehensive. The degree of cross browser compatibility is not impressive. |
LEFT BUTTON | ||||||||||||
Internet Explorer | Mozilla (Windows or Unix before 1.7) Netscape (6.1 to 7.1) |
Mozilla (Macintosh or from 1.7) Netscape 7.2 (probably) |
Netscape 4 | Opera | Safari | |||||||
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
|
DOWN | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown |
UP | mouseup click | mouseup click |
mouseup click | mouseup click |
mouseup click | mouseup click |
mouseup click | mouseup click |
mouseup click | mouseup click |
mouseup click | mouseup click |
DOWN | - | mousedown mousedown |
mousedown | mousedown | click dblclick |
mousedown | ||||||
UP | mouseup dblclick |
mouseup click dblclick |
mouseup click dblclick |
mouseup click |
mouseup | mouseup dblclick |
||||||
event.which | undefined | 1 | 1 | 1 | 1 | |||||||
event.button | 1 | 0 (1 for Netscape 6.0) | undefined | 1 | 1 | |||||||
MIDDLE BUTTON | ||||||||||||
Internet Explorer | Mozilla (through 1.6) Netscape (6.1 to 7.1) |
Mozilla (from 1.7) Netscape 7.2 (probably) |
Netscape 4 | Opera | ||||||||
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
|||
Disabling paste requires config file edit | Disabling paste requires config file edit | Cannot disable paste? | Cannot disable browser actions | |||||||||
DOWN | ? | ? | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | mousedown | ||
UP | ? | ? | mouseup | mouseup click |
mouseup | mouseup | mouseup | mouseup | - | - | ||
DOWN | ? | mousedown mousedown |
mousedown | mousedown | mousedown | |||||||
UP | ? | mouseup | mouseup | mouseup click |
- | |||||||
event.which | undefined | 2 | 2 | 3 | ||||||||
event.button | 4 | 1 (2 for Netscape 6.0) | undefined | 3 | ||||||||
RIGHT BUTTON | ||||||||||||
Internet Explorer | Mozilla (through 1.6) Netscape (6.1 to 7.1) |
Mozilla (from 1.7) Netscape 7.2 (probably) |
Netscape 4 | Opera | ||||||||
Disabling context menu requires some weird stuff | Only versions after 7.23 with File > Preferences > Multimedia > Javascript options > Allow script to receive right clicks | |||||||||||
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
Single Click | Double Click |
|||
DOWN | mousedown | mousedown | mousedown contextmenu | mousedown contextmenu |
mousedown contextmenu | mousedown contextmenu |
mousedown | mousedown | mousedown | mousedown | ||
UP | mouseup contextmenu | mouseup contextmenu |
mouseup | mouseup | mouseup | mouseup | - | - | - | - | ||
DOWN | mousedown | mousedown contextmenu mousedown contextmenu |
mousedown contextmenu |
mousedown | mousedown | |||||||
UP | mouseup contextmenu |
mouseup | mouseup | - | - | |||||||
event.which | undefined | 3 | 3 | 2 | ||||||||
event.button | 2 | 2 (3 for Netscape 6.0) | undefined | 2 |