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 id=foo>Foo</button>
</body>
</html>
 
function logEvent(e) {
  console.log(e);
}
var button = document.getElementById('foo');
button.addEventListener('click', logEvent);
button.click();
button.dispatchEvent(new MouseEvent('click', {clientX: 20, clientY: 20}));
Output

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

Dismiss x
public
Bin info
dtapuskapro
0viewers