title: JavaScript not executing in my HTML
body: <p>So I've begun learning HTML/CSS/JavaScript and came across this issue while trying to make an exceedingly simple version of rock-paper-scissors. I believe that the code works fine, but I can't check because <strong>it refuses to execute.</strong> I have looked extensively for answers on the internet, but can't seem to find any. <em>I have very little experience in JavaScript</em>, I am currently learning it off of <a href="http://www.codecademy.com/tracks/javascript" rel="nofollow">Codecademy</a> but I think that resource may be outdated as <a href="http://www.w3schools.com/js/default.asp" rel="nofollow">other websites</a> appear to have conflicting syntax. In short, <strong>what am I doing wrong, and which website has it right?</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;R,P,S!&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function whole(){
              function game(play){
                  if (play="yes"){
                      var userChoice = prompt("Do you choose rock, paper or scissors?");
                      var computerChoice = Math.random();
                      if (computerChoice &lt; 0.34) {
                          computerChoice = "rock";}
                      else if(computerChoice &lt;= 0.67) {
                          computerChoice = "paper";}
                      else {
                          computerChoice = "scissors";
                      }
                      function compare(choice1,choice2){
                          if (choice1==choice2){
                              compare(userChoice,computerChoice);
                          }
                          if (choice1=="rock"){
                              if (choice2=="scissors"){
                                  document.getElementById("result").innerHTML="Rock wins";
                              }
                              else{
                                  document.getElementById("result").innerHTML="Paper wins";
                              }
                          }
                          if (choice1=="paper"){
                              if (choice2=="rock"){
                                  document.getElementById("result").innerHTML="Paper wins";
                              }
                              else{
                                  document.getElementById("result").innerHTML="Scissors win";
                              }
                          }
                          if (choice1=="scissors"){
                              if (choice2=="paper"){
                                  document.getElementById("result").innerHTML="Scissors win";
                              }
                              else{
                                  document.getElementById("result").innerHTML="Rock wins";
                              }
                          }
                      };
                      compare(userChoice,computerChoice);
                  }
                  else{
                      document.writeln("&lt;p&gt;Thanks for playing! This was made by Alex&lt;/p&gt;";)
                  }
              }
              var start = prompt ("Do you want to play?","Yes");}
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body style="text-align:center"&gt;
      &lt;h1&gt;JavaScript on a webpage? This is madness!&lt;/h1&gt;
      &lt;h2&gt;Madness? THIS... IS... HTML!!!!&lt;/h2&gt;
      &lt;button onclick="whole()"&gt;Try it out!&lt;/button&gt;
      &lt;p id="result"&gt;Who won?&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>**Edit: It appears that Codecademy's glossary agrees with other websites, they just haven't gotten around to editing their lessons yet.*</p>
  
  <p>**Edit: Here's my final little code for it. Enjoy its simplicity!*</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;R,P,S!&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function whole(){
              function game(play){
                  if (play=="Yes"||play=="yes"){
                      var userChoice = prompt("Do you choose rock, paper or scissors?");
                      var computerChoice = Math.random();
                      if (computerChoice &lt; 0.34) {
                          computerChoice = "rock";}
                      else if(computerChoice &lt;= 0.67) {
                          computerChoice = "paper";}
                      else {
                          computerChoice = "scissors";
                      }
                      function compare(choice1,choice2){
                          if (choice1==choice2){
                              alert("It was a tie!");
                              game("yes");
                          }
                          if (choice1=="rock"){
                              if (choice2=="scissors"){
                                  document.getElementById("messages").innerHTML="";
                                  document.getElementById("win").innerHTML="You win. Rock crushes scissors.";
                                  document.getElementById("loss").innerHTML="";
                              }
                              else{
                                  document.getElementById("messages").innerHTML="";
                                  document.getElementById("loss").innerHTML="You lose. Paper smothers rock.";
                                  document.getElementById("win").innerHTML="";
                              }
                          }
                          else if (choice1=="paper"){
                              if (choice2=="rock"){
                                  document.getElementById("messages").innerHTML="";
                                  document.getElementById("win").innerHTML="You win. Paper smothers rock.";
                                  document.getElementById("loss").innerHTML="";
                              }
                              else{
                                  document.getElementById("messages").innerHTML="";
                                  document.getElementById("loss").innerHTML="You lose. Scissors cut paper.";
                                  document.getElementById("win").innerHTML="";
                              }
                          }
                          else if (choice1=="scissors"){
                              if (choice2=="paper"){
                                  document.getElementById("messages").innerHTML="";
                                  document.getElementById("win").innerHTML="You win. Scissors cut paper.";
                                  document.getElementById("loss").innerHTML="";
                              }
                              else{
                                  document.getElementById("messages").innerHTML="";
                                  document.getElementById("loss").innerHTML="You lose. Rock crushes scissors.";
                                  document.getElementById("win").innerHTML="";
                              }
                          }
                          else{
                              alert("Very funny. Now do it right.");
                              game("yes");
                          }
                      };
                      compare(userChoice,computerChoice);
                  }
                  else{
                      document.getElementById("messages").innerHTML="Well alrighty then.";
                      document.getElementById("loss").innerHTML="";
                      document.getElementById("win").innerHTML="";
                  }
              }
              var start = prompt ("Do you want to play?","Yes");
              game(start);}
      &lt;/script&gt;
      &lt;style&gt;
          body{
              text-align:center;
          }
          #messages{
              font-size:20px;
              color: #00246B;
          }
          #win{
              color: #29A329;
              font-size:18px;
          }
          #loss{
              color:#CC0000;
              font-size:18px;
          }
          a{
              text-decoration:none;
              color:black;
          }
          a:hover{
              font-size:125%;
              color:#B20000;
          }
          button{
              font-size:21px;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;a href="http://youtu.be/T8r3cWM4JII"&gt;
      &lt;h1&gt;JavaScript on a webpage? This is madness!&lt;/h1&gt;
      &lt;h2&gt;Madness? THIS... IS... HTML!!!!&lt;/h2&gt;
      &lt;/a&gt;
      &lt;button onclick="whole()"&gt;Try it out!&lt;/button&gt;
      &lt;p id="messages"&gt;Who won?&lt;/p&gt;
      &lt;p class="result"&gt;&lt;span id="loss"&gt;&lt;/span&gt;&lt;span id="win"&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>