Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>Mouse Events</h1>
<h2>The buttons Property</h2>
<div onmousedown="WhichButton(event)" style="border:1px solid black;padding:8px">
<p>Click in this box with a mouse button.</p>
<p>
1 = The left button<br>
2 = The right button<br>
4 = The middle button<br>
8 = The fourth button (Browser Back)<br>
16 = The fifth button (Browser Forward)<br>
</p>
</div>
<p>The values are combined if you press two buttons at once.</p>
<p>You pressed: <span id="demo"></span></p>
<script>
function WhichButton(event) {
  let x = event.buttons;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>