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</button>
  <button>DBL CLICK</button>
  <button>MOUSE DOWN</button>
  <button>MOUSE UP</button>
  <button>MOUSE OVER</button>
  <output></output>
</body>
</html>
 
var btnClick = document.querySelectorAll('button')[0],
    btnDblClick = document.querySelectorAll('button')[1],
    btnMouseDown = document.querySelectorAll('button')[2],
    btnMouseUp = document.querySelectorAll('button')[3],
    btnMouseOver = document.querySelectorAll('button')[4];
btnClick.addEventListener('click', function (e) {
  document.querySelector('output').innerHTML = e.detail;
}, false);
btnDblClick.addEventListener('dblclick', function (e) {
  document.querySelector('output').innerHTML = e.detail;
}, false);
btnMouseDown.addEventListener('mousedown', function (e) {
  document.querySelector('output').innerHTML = e.detail;
}, false);
btnMouseUp.addEventListener('mouseup', function (e) {
  document.querySelector('output').innerHTML = e.detail;
}, false);
btnMouseOver.addEventListener('mouseover', function (e) {
  document.querySelector('output').innerHTML = e.detail;
}, false);
Output

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

Dismiss x
public
Bin info
ImpressiveWebspro
0viewers