title: How to have multiple buttons of same id value and when click on any button the pop-up should come?
body: <p>I have multiple buttons having same element id, But when I click on first button, the pop-up is coming. If I click on any other buttons pop-up will not come. How can I make it possible.</p>
  
  <pre><code>&lt;form method="post" action="trial.php"&gt;
  
  &lt;!-- Trigger/Open The Modal --&gt;
  &lt;input type="button" id="myBtn" value="assign"&gt;&lt;/input&gt;
  &lt;input type="button" id="myBtn" value="asd"&gt;&lt;/input&gt;
  &lt;input type="button" id="myBtn" value="assign"&gt;&lt;/input&gt;
  &lt;input type="button" id="myBtn" value="assign"&gt;&lt;/input&gt;
  &lt;input type="button" id="myBtn" value="assign"&gt;&lt;/input&gt;
  
  &lt;!-- The Modal --&gt;
  &lt;div id="myModal" class="modal"&gt;
      &lt;!-- Modal content --&gt;
      &lt;div class="modal-content"&gt;
          &lt;span class="close"&gt;&amp;times;&lt;/span&gt;
          &lt;p&gt;Assign Project&lt;/p&gt;
          &lt;hr style="height:0.25px; background:black;"&gt;&lt;/hr&gt;
          &lt;div class="container"&gt;
            &lt;div class="row"&gt;
                &lt;p class="col-md-10"&gt;&lt;br/&gt;Assign Project to a Existing Team : 
                &lt;a class="btn btn-primary" id="ExistingTeam" value="Existing Team" href="google.com"&gt;Existing Team&lt;/a&gt;&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="row"&gt;
                &lt;p class="col-md-10"&gt;&lt;br/&gt;Create a new Team and Assign Project : 
                &lt;a class="btn btn-primary" id="CreateTeam" value="Create Team" href="google.com"&gt;Create Team&lt;/a&gt;&lt;/p&gt;  
            &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>These is the javascript I am using for pop-up</p>
  
  <pre><code>&lt;script&gt;
  // Get the modal
  var modal = document.getElementById('myModal');
  
  // Get the button that opens the modal
  var btn = document.getElementById("myBtn");
  
  // Get the &lt;span&gt; element that closes the modal
  var span = document.getElementsByClassName("close")[0];
  
  // When the user clicks the button, open the modal 
  btn.onclick = function() {
      modal.style.display = "block";
  }
  
  // When the user clicks on &lt;span&gt; (x), close the modal
  span.onclick = function() {
      modal.style.display = "none";
  }
  
  // When the user clicks anywhere outside of the modal, close it
  window.onclick = function(event) {
      if (event.target == modal) {
          modal.style.display = "none";
      }
  }
  &lt;/script&gt;
  </code></pre>