title: getElementsByTagName does not seem to work
body: <p>Can someone please explain why my code is not working !! </p>
  
  <p>When I get the element By Id it works perfectly fine. But the same method with getElementsByTagName() does not. </p>
  
  <p>Also if I use querySelector(), it works. However if I use querySelectorAll() the same error returns.</p>
  
  <p>test.html:15 Uncaught TypeError: Cannot set property 'color' of undefined</p>
  
  <p>here is my code:</p>
  
  <pre><code>&lt;DOCTYPE! html&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;h1&gt;Hello World&lt;/h1&gt;
  &lt;p id="par"&gt;Hello World&lt;/p&gt;
  
  &lt;script&gt;
  var par = document.getElementById('par');
  par.style.color = "red"
  var heading = document.getElementsByTagName("h1");
  heading.style.color = "red"
  &lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>