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>
  <input type="text">
  <button id="button">Hey</button>
</body>
</html>
 
document.querySelector("#button").addEventListener("click", function(event) {
  console.log("click");
}, false);
document.querySelector("#button").addEventListener("mousedown", function(event) {
  console.log("mousedown");
}, false);
document.querySelector("#button").addEventListener("keypress", function(event) {
  var keyCode = event.keyCode || event.which;
  console.log("keypress");
}, false);
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers