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>
<div id="GameOne">
    <h1>~ Game One ~</h1>
    <h2>Try to get three 7's!</h2>
    <span class="so Spinner">--</span> | 
    <span class="st Spinner">--</span> | 
    <span class="sth Spinner">--</span>
    <br/>
    <button id="SpinButton">Spin!</button>
</div>
</body>
</html>
 
function roll() {
  var n = Math.floor((Math.random() * 10) + 1);
  return (n === 1 ? 'Ace!' : n);
}
function StartSpin(){
  var slots = document.getElementsByClassName("Spinner");
  
  for (var i = 0, e = slots.length; i < e; i++) {
    slots[i].innerHTML = roll();
  }
}
document.getElementById('SpinButton').addEventListener('click', StartSpin);
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers