title: document.getElementById can't select more than one element
body: <p>I'm working on loading. I have div <code>#loading</code> which is visible. And more divs <code>#message</code> which are hidden. I have js function.</p>
  
  <pre><code>function loading() {
       setTimeout(function() {
           document.getElementById("loading").style.display = "none";
           document.getElementById("message").style.display = "block";
       }, 500, "fadeOut");
   }
  </code></pre>
  
  <p>But that row <code>document.getElementById("message").style.display = "block";</code> selects only first div <code>#message</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function loading() {
    setTimeout(function() {
      document.getElementById("loading").style.display = "none";
      document.getElementById("message").style.display = "block";
    }, 500, "fadeOut");
  }
  loading();</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#loading {
    display: block;
  }
  #message {
    display: none;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="messages" onload="loading();"&gt;
    &lt;div id="loading"&gt;
      ...
    &lt;/div&gt;
    &lt;div id="message"&gt;
      QWERTY
    &lt;/div&gt;
    &lt;div id="message"&gt;
      123456
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>