Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script> function WhichButton(event) { alert("You pressed button: " + event.button) } </script> </head> <body> <div onmousedown="WhichButton(event);">Click this text (with one of your mouse-buttons) <p> 0 Specifies the left mouse-button<br> 1 Specifies the middle mouse-button<br> 2 Specifies the right mouse-button</p> <p><strong>Note:</strong> Internet Explorer 8, and earlier, returns another result:<br> 1 Specifies the left mouse-button<br> 4 Specifies the middle mouse-button<br> 2 Specifies the right mouse-button</p> </div> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_events_onmousedown2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:37:17 GMT --> </html>
Result:
Try it Yourself - © w3schools.com