title: Javascript getElementsByClassName - select all elements
body: <p>I want to hide all the elements with class <code>asp</code> but the problem is that following code just hides 1 element but doesn't work for other 1000 rows/elements. How can I hide all elements with the class "asp" ? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function toggleFunction() {
      var hide = document.getElementsByClassName('asp')[0].style.visibility='hidden';
  }
  
  toggleFunction()</code></pre>
  </div>
  </div>
  </p>