Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <button id="button">Touch me!</button>
  
  <button id="enviar">Enviar</button>
  <button id="borrar">Borrar</button>
</body>
</html>
 
/* const button = document.getElementById('button');
button.addEventListener('click', clickAlert)
function clickAlert() {
  alert('me tocaste!');
}
*/
const enviar = document.getElementById('enviar');
const borrar = document.getElementById('borrar');
enviar.addEventListener('click', clickAlert);
borrar.addEventListener('click', clickAlert);
function clickAlert() {
  alert(`hiciste click en el boton ${this.id}`);
}
Output

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

Dismiss x
public
Bin info
yeion7pro
0viewers