如何在选择按钮组中的特定按钮时分配不同的URL链接?

I want to create a group of buttons that when clicked will return different download link to the user email. I am trying to do it with javascript switch but I not sure how to return the download link so that the download link can be retrieved using PHP get to send in the email.

<div class="row">
  <div class="col-md-3">
    <div class="text-center">
      <i class="fa fa-file" style="font-size:48px; color:#00ffff;"></i>
      <span><h6>User Manual:Accounting</h6></span>
      <button class="downloadButton" id="401" type="button" data-toggle="modal" data-target="#downloadModal" style="border-radius:5px; outline:none; background-color:Transparent;">
      <i class="fa fa-download" style="font-size:24px; color:#737373;"></i>
      </button>
   </div>
 </div>

 <script>
function linkFunction(){
    var buttonClass = document.getElementsByClassName["download-button"];
    var buttonId = buttonId.attr('id');
    var link;

Is this maybe what you're looking for? Hope it helps!

<html>
<head>
<script>
window.onload = doThis;

/* This one would work well and allow you to pass arguments */
function doThis() {
  var buttonClass = document.getElementById("download_button");
  var buttonId = buttonClass.id;
  var buttonName = buttonClass.name;
  var buttonLinkId = buttonClass.getAttribute('data-linkId');

  buttonClass.addEventListener('click', buttonClickedCaller);

  function buttonClickedCaller(){
    buttonClicked(buttonLinkId);
  }

  function buttonClicked(foo) {
    console.log('http://localhost/?' + foo);
    window.location = 'http://localhost/?' + foo;
    // window.open('http://localhost/?'+foo);
  }
}

/*
// here's a simpler example
function doThis() {
  var buttonClass = document.getElementById("download_button");
  var buttonId = buttonClass.id;
  var buttonName = buttonClass.name;
  var buttonLinkId = buttonClass.getAttribute('data-linkId');

  buttonClass.addEventListener('click', buttonClicked);

  function buttonClicked() {
    console.log('http://' + buttonLinkId);
  }
}

//  careful though, this won't work.
function doThis() {
  var buttonClass = document.getElementById("download_button");
  var buttonId = buttonClass.id;
  var buttonName = buttonClass.name;
  var buttonLinkId = buttonClass.getAttribute('data-linkId');
  // Passing a Variable in Below Here
  buttonClass.addEventListener('click', buttonClicked(buttonLinkId));
  // Will Break Here & It's executed onload, but the above one isn't
  function buttonClicked(foo) {
    console.log('http://' + foo);
  }
}
*/


</script>
</head>
<body>
<div class="row">
  <div class="col-md-3">
    <div class="text-center">
      <span><h6>User Manual:Accounting</h6></span>
      <button id="download_button" data-linkId="401">
        Click Here
      </button>
    </div>
  </div>
</body>
<html>