title: How can select from same Id's different values?
body: <p>So I want to make a web page switch pages without loading , but I cannot seem to understand how to verify when a different different value is in my Id:</p>
  
  <pre><code>&lt;div id='myId'&gt;home&lt;/div&gt;
  &lt;div id='myId'&gt;market&lt;/div&gt;
  </code></pre>
  
  <p>Want to output it to:</p>
  
  <pre><code>&lt;div id="dankMeme"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And this is my script:</p>
  
  <pre><code>var element = document.getElementById('myId'); 
  element.addEventListener('click', () =&gt; {
      switch(element.innerHTML) {
      case "market":
          document.getElementById("dankMeme").innerHTML = "you are in the market";
          break;
      case "home":
          document.getElementById("dankMeme").innerHTML = "you are in the home";
          break;
      default:
          // code block
      }
  });
  </code></pre>
  
  <p>why does it only work with the first id ?
  how can I make it work with all Id's?</p>