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>
  <a id = "abc" >Enlace</a>
</body>
</html>
 
a{
  text-decoration: underline;
  color: blue;
  cursor: pointer;
}
 
function fn (a){
    console.log(a);
}
var a = document.getElementById("abc");
a.addEventListener("click", function(){
    fn(this.id);
}, false);
Output

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

Dismiss x
public
Bin info
Alexis88pro
0viewers