title: Based on Multiple checkbox selection, “mailto:” link changes to “mailto: multiple variables” using javascript
body: <p>I'm trying to make a form. The way it would work is that the user chooses up to 3 options from  10 multiple selection checkboxes. They then click the confirm location button. Finally they click the send email link. Basically when they click the confirm location button, it changes the mailto link in the send email link, based on their selection (up to 3) in the multiple checkboxes. However, what I cannot figure is how to set up the multiple selection checkboxes(with a max limit of 3 and min of 1), and then add the single/multiple email values in the mailto link.
  I have managed to do this for a drop-down list (only 1 selection, hence only 1 email), but I cannot figure out the above. Please help!</p>
  
  <pre><code>&lt;form&gt;Select your place:
      &lt;select id="mySelect"&gt;
          &lt;option value="email@domain.com"&gt;Location 1&lt;/option&gt;
          &lt;option value="email2@domain.com"&gt;Location 2&lt;/option&gt;
          &lt;option value="email3@domain.com"&gt;Location 3&lt;/option&gt;
          &lt;option value="email4@domain.com"&gt;Location 4&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  &lt;button type="button" onclick="displayResult()"&gt;Confirm Location&lt;/button&gt;
  &lt;a id="myEmailList" href="mailto:"&gt;Send email&lt;/a&gt;
  &lt;script type="text/javascript"&gt;
  function displayResult() {
      var x = document.getElementById("mySelect");
      t = x.value
      document.getElementById("myEmailList").href = "mailto:"t;
  }
  &lt;/script&gt;
  </code></pre>