Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <button>CLICK ME</button>
  
  <output></output>
  <output></output>
  <output></output>
  <output></output>
</body>
</html>
 
var btn = document.querySelector('button'),
    op = document.querySelectorAll('output');
btn.addEventListener('mousedown', function (e) {
  op[0].innerHTML = '<p><b>ALT key:</b> ' + e.altKey + '</p>';
  op[1].innerHTML = '<p><b>CTRL Key:</b> ' + e.ctrlKey + '</p>';
  op[2].innerHTML = '<p><b>SHIFT Key:</b> ' + e.shiftKey + '</p>';
  op[3].innerHTML = '<p><b>Which mouse button:</b> ' + e.button + '</p>';
}, false);
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ImpressiveWebspro
0viewers