title: How to change the style of elements with same class name
body: <p>Using javascript, I want to change the style of class <code>.s</code> into </p>
  
  <pre><code>.s {
    display: block;
  }
  </code></pre>
  
  <p>Why this cannot work:</p>
  
  <pre><code>document.getElementsByClassName('s').style.display='block';
  </code></pre>