HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <div onmousedown="myFunction(event)"> <p> Click any <br> 1 = The left mouse button<br> 2 = The right mouse button<br> 3 = Both left and right mouse button<br> 4 = The middle mouse button<br> 5 = Both left and middle mouse button<br> 6 = Both right and middle mouse button<br> 7 = Left, right and middle mouse button<br> 8 = The fourth mouse button (typically the "Browser Back" button)<br> 16 = The fifth mouse button (typically the "Browser Forward" button)<br> </p> </div> <h2>You Clicked : <span id="point"></span></h2> <script> function myFunction(event){ document.getElementById("point").innerHTML = event.buttons; } </script> </body> </html>
OUTPUT
×

Save as Private