title: window.location Does not work in javascript
body: <p>This code below for some reason doesn't work when trying to redirect. I have tried several other ways such as window.location.href and more. The only thing that works is <code>window.open ("")</code> but this opens a page in a new window when I need it to be on the same. If I do <code>window.open("", "_self")</code> then it does not work again. If I replace the <code>window.location</code> with an <code>alert</code> it works fine, so I think the overall code is normal just something preventing it from redirecting on the same page. This issue is also on my Windows Chrome and a Mac Firefox.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script type="text/javascript"&gt;
              function checkAnswers(){    
                  getElementById("myQuiz");
                  if(myQuiz.elements[1].checked){
                      window.location = "www.google.com";
                  }else{
                      alert("Failed");
                  }
              };
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;img src="Castle.JPG" /&gt;
          &lt;form id="myQuiz" onsubmit="checkAnswers()" action=""&gt;
              &lt;p&gt;Name the country this castle is located in?
                  &lt;br/&gt;
                  &lt;input type="radio" name="radiobutton" value="A"/&gt;
                  &lt;label&gt;England&lt;/label&gt;
                  &lt;input type="radio" name="radiobutton" value="B"/&gt;
                  &lt;label&gt;Ireland&lt;/label&gt;
                  &lt;input type="radio" name="radiobutton" value="C"/&gt;
                  &lt;label&gt;Spain&lt;/label&gt;
                  &lt;input type="radio" name="radiobutton" value="D"/&gt;
                  &lt;label&gt;France&lt;/label&gt;
                  &lt;input type="submit" name="submit" value="Submit"/&gt;
                  &lt;input type="reset" name="reset" value="Reset"/&gt;
              &lt;/p&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>