title: Changing multiple elements' styles with a same class name at once with JavaScript?
body: <p>I have a bunch of divs with different combinations of classes in each (e.g. "a A", "a b", "b A", "b" etc.).</p>
  
  <p>With a press of a button, I need to change the styles of, for example, all elements which have the class A (not only 'A', but must include it. E.g. both "d A" and "A" would work)</p>
  
  <p>I have tried </p>
  
  <blockquote>
    <p>document.getElementsByClassName('a A').style.background = "#f00";</p>
  </blockquote>
  
  <p>but it didn't work. The console says that it can't set a style for element 'undefined', so I guess it doesn't get what I need with <code>getElementsByClassName();</code>.</p>