title: Javascript: Some Variables Defined, Some Undefined
body: <p>I am writing a basic casino javascript game that will randomly pick 3 numbers 1-10. If each number is 7, it will display an alert box saying 'You Win!'. In the function below:    </p>
  
  <pre><code>function StartSpin(){
          var one;
          var two;
          var three;
          var cone;
          var ctwo;
          var cthree;
          var one = Math.floor((Math.random() * 10) + 1);
          var two = Math.floor((Math.random() * 10) + 1);
          var three = Math.floor((Math.random() * 10) + 1);
          if(one == 1){var cone = "Ace";}
          if(two == 1){var ctwo = "Ace";}
          if(three == 1){var cthree = "Ace";}
          document.getElementsByClassName("Spinner")[0].innerHTML= cone
          document.getElementsByClassName("Spinner")[1].innerHTML= ctwo
          document.getElementsByClassName("Spinner")[2].innerHTML= cthree
      }
  </code></pre>
  
  <p>On the actual page before clicking the button to start randomizing it says:
  --|--|--. When clicking it, it sets the --'s to the randomized number. Every number/-- set says undefined except sometimes one will say 'Ace' meaning it was 1. So it might say: undefined|Ace|undefined, or undefined|undefined|undefined, etc.
  Here is the HTML:</p>
  
  <pre><code>&lt;div id="GameOne"&gt;
      &lt;h1&gt;~ Game One ~&lt;/h1&gt;
      &lt;h2&gt;Try to get three 7's!&lt;/h2&gt;
      &lt;span class="so Spinner"&gt;--&lt;/span&gt; | 
      &lt;span class="st Spinner"&gt;--&lt;/span&gt; | 
      &lt;span class="sth Spinner"&gt;--&lt;/span&gt;
      &lt;br/&gt;
      &lt;button id="SpinButton" onclick="StartSpin()"&gt;Spin!&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>EDIT: I re-defined variables to see if that would help the undefined problem(In the javascript code fyi)</strong></p>