Javascript examples for DOM Event:onmousedown
Check which mouse button was clicked
<!DOCTYPE html> <html> <body> <div onmousedown="WhichButton(event)">Click this text </div>/*from w w w. ja va 2 s .c o m*/ <script> function WhichButton(event) { console.log("You pressed button: " + event.button) } </script> </body> </html>