title: Get multiple elements by Id
body: <p>I have a page with anchor tags throughout the body like this:</p>
  
  <pre><code>&lt;a id="test" name="Name 1"&gt;&lt;/a&gt;
  &lt;a id="test" name="Name 2"&gt;&lt;/a&gt;
  &lt;a id="test" name="Name 3"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>The ID is always the same but the name changes.</p>
  
  <p>I need to populate a list of the names of these anchor tags, for example; Name 1, Name 2, Name 3. This is where I've got to so far:</p>
  
  <pre><code>document.write(document.getElementById("readme").name);
  </code></pre>
  
  <p>This writes out the name of the first anchor tag. I'm in need of a way to get multiple elements by Id.</p>
  
  <hr>
  
  <p>Any help is greatly appreciated.</p>