Make multi checkbox getElementById with url link and change the link with value?
<p>I have code like this... I want if I click checkbox for ex. hotel1, link <code>+check+</code> will change hotel1, and if I click checkbox hotel2, link <code>+check+</code> will change hotel2....
but the link not change...any idea?</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
 function link() {
 var locationSearch = document.getElementById("locationSearchTerms").value;
 var textSearch = document.getElementById("textSearchTerms").value;
 var check = document.getElementsByName("checkbox1").value;
 window.location.href = "http://www.server12.com/ser2/"+check+"/?textSearchTerms="+textSearch+"&amp;locationSearchTerms="+locationSearch+"";
 }
&lt;/script&gt;</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form id="search" method="get" class="form-inline"&gt;
        &lt;div class="col-md-6"&gt;
     Destination:  
      &lt;input type="text" class="form-control" placeholder="Ex: Aston" name="textSearchTerms" id="textSearchTerms"&gt;
    
     Location:
      &lt;input type="text" class="form-control" placeholder="Ex:Denpasar" name="locationSearchTerms" id="locationSearchTerms"&gt;  &amp;nbsp;  &amp;nbsp;
        &lt;button type="button" class="btn btn-primary" data-toggle="button" aria-pressed="false" autocomplete="off"  onclick="link()"&gt;&lt;span class=" glyphicon glyphicon-search" aria-hidden="true"&gt; Search&lt;/button&gt;
        
     &lt;br /&gt;
     &lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel"&gt;Hotel
        &lt;label&gt;&lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel1"&gt;Hotel1
        &lt;label&gt;&lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel2"&gt;Hotel2
        &lt;label&gt;&lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel3"&gt;Hotel3
        &lt;label&gt;&lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel4"&gt;Hotel4
        &lt;label&gt;&lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel5"&gt;Hotel5
        &lt;label&gt;&lt;br /&gt;
        &lt;label class="checkbox-inline"&gt;&lt;input type="checkbox" name="checkbox1" id="checkbox1"  value="Hotel5"&gt;Hotel6
        &lt;label&gt;&lt;br /&gt;

     &lt;/div&gt;
    &lt;/form&gt; </code></pre>
</div>
</div>
</p>