title: How can I get HTML elements by class in JavaScript?
body: <p>I'm trying to manipulate the HTML through <code>getElementsByClass()</code> but for some reason it doesn't work. When I use <code>document.getElementByID()</code> it works? Why is this?</p>
  
  <pre><code>&lt;div class='boldStuff'&gt; &lt;p&gt;Welcome to the site. &lt;/p&gt; &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      document.getElementsByClass('boldStuff').innerHTML = 'Fred Flinstone';
  &lt;/script&gt;
  </code></pre>