title: Open JavaScipt URL in new window
body: <p>Wondering if anyone can help. I've created some code that depending on what option the user picks, they get taken to a specific URL. I have it all working fine, however, the URL won't open in a new window.</p>
  <p>Any help would be brilliant.</p>
  <p>This is the code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> $(document).ready(function() {
      var selectVal1 = $("#selectBox1").val();
      var selectVal2 = $("#selectBox2").val();
      $("#selectBox1").change(function() {
              selectVal1 = $("#selectBox1 option:selected").val();
      });
      $("#selectBox2").change(function() {
              selectVal2 = $("#selectBox2 option:selected").val();
      });
      
      $("#click").click(function() {
      
      if(selectVal1 == 'A' &amp;&amp; selectVal2 == 'A'){
          location = "https://www.google.com/animalmanagement-25thaug", '_blank';}
      else if(selectVal1 == 'A' &amp;&amp; selectVal2 == 'B'){        
          location = "https://www.google.com/animalmanagement-26thaug", '_blank';}
      if(selectVal1 == 'B' &amp;&amp; selectVal2 == 'A'){
          location = "https://www.google.com/artdesign-25thaug", '_blank';}
      else if(selectVal1 == 'B' &amp;&amp; selectVal2 == 'B'){        
          location = "https://www.google.com/artdesign-26thaug", '_blank';}
  });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://www.sthelens.ac.uk/book-slot/book-enrolment.js"&gt;&lt;/script&gt;
  
  &lt;h3&gt;Book Your Enrolment Slot&lt;/h3&gt;
  &lt;select id="selectBox1"&gt;
    &lt;option value=""&gt;Select which subject you would like to study?&lt;/option&gt;
    &lt;option value="A"&gt;Animal Management&lt;/option&gt;
    &lt;option value="B"&gt;Art &amp;amp; Design&lt;/option&gt;
  &lt;/select&gt;
  &lt;select id="selectBox2"&gt;
    &lt;option value=""&gt;Select what date you would like to come in and enrol&lt;/option&gt;
    &lt;option value="A"&gt;Tuesday 25th August 2020&lt;/option&gt;
    &lt;option value="B"&gt;Wednesday 26th August 2020&lt;/option&gt;
  &lt;/select&gt;
  &lt;input id="click" type="button" value="Book Now" class="button"&gt;</code></pre>
  </div>
  </div>
  </p>