title: Can't redirect to a page after radio button selection
body: <p>I have the following HTML to give two radio button options. If the user selects one option and click submit, it will go to the corresponding page.</p>
  
  <pre><code>&lt;script src="js/jump.js"&gt;&lt;/script&gt;
  
  &lt;form onsubmit="jump()"&gt;
  &lt;input type="radio" name="querytype" value="apple"&gt;Go to Apple page&lt;br&gt;
  &lt;input type="radio" name="querytype" value="orange"&gt;Go to Orange page&lt;br&gt;
  &lt;input type="submit" value="OK"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In the JS file jump.js, I have the following function:</p>
  
  <pre><code>function jump() {
      var selected = document.getElementsByName('querytype');
  
      for(var i=0; i&lt;selected.length; i++) {
      var value = selected[i].value;
      if (selected[i].checked) {
          if (value === 'apple') {
          window.location.href = '/myapp/apple-page';
          } else {
          window.location.href = '/myapp/orange-page';
          }
      } 
      }
  }
  </code></pre>
  
  <p>But this is not working. When I make a choice and submit it, it doesn't go to either "Apple" or "Orange" page, but it shows a blank page. How do I make it happen?</p>