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 class="game_join_a" data-tbl="1">1</a>
  <a class="game_join_a" data-tbl="2">2</a>
  <a class="game_join_a" data-tbl="3">3</a>
  <a class="game_join_a" data-tbl="4">4</a>
  <a class="game_join_a" data-tbl="5">5</a>
</body>
</html>
 
var a = document.getElementsByClassName("game_join_a");
for(i = 0; i < a.length; i++) {
    a[i].addEventListener("click", function (e) {
        console.log(e.currentTarget.getAttribute("data-tbl"));
    }, false);
}
Output

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

Dismiss x
public
Bin info
_alexander_pro
0viewers