title: getElementsByClass and appendChild
body: <p>just brushing up on my javascript skills and trying to figure out why getElementsByClass isn't working for my code.  The code is pretty simple.  Upon clicking a button "clicky", the script will create a child h1 element of div.  It works perfectly fine when I use getElementById and changing the div class to Id but doesn't work when I change it to class.</p>
  
  <p>I've tried, getElementsByClassName, getElementsByClass, getElementsByTagName and changing the div to the appropriate attribute but no luck.  </p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
  
  &lt;body&gt;
  &lt;p&gt;Click on button to see how appendChild works&lt;/p&gt;
  
  &lt;button onclick="myFunction()"&gt;Clicky &lt;/button&gt;
  
  &lt;script&gt;
  function myFunction(){
  var first = document.createElement("H1");
  var text = document.createTextNode("Jason is pretty awesome");
  first.appendChild(text);
  
  document.getElementsByName("thistime").appendChild(first);
  
  }
  &lt;/script&gt;
  
  &lt;div class="thistime"&gt;Hi&lt;/div&gt;
  
      &lt;/body&gt;
  
  
  
  
  
  
  &lt;/html&gt;
  </code></pre>