title: getElementsByClassName to change the style of elements when event occurs
body: <p>I'm trying to use </p>
  
  <pre><code> onmouseover="document.getElementsByClassName().style.background='color'"
  </code></pre>
  
  <p>to change the color of all divs with a given classname to another color when hovering over another page element.</p>
  
  <p>Here is a jsfiddle -if anyone could give a few helpful pointers as to where I'm going wrong that would be great, I'm sure it's something really obvious that I'm missing. It worked with document.getElementById, but that only changed the color of the first div, not all of them.</p>
  
  <p>Thanks :)</p>