title: JS: Making certain elements hidden via getElementsByClassName
body: <p>I'm trying to set up a script that sets invisible everything with a certain class name. 
  This is an example of what I'm trying to call:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function hideItems(){
          document.getElementsByClassName('class1').style.visibility = "hidden";      
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>The class names are on the dimensions of a table, similar to this example:</p>
  
  <pre><code>&lt;table onclick="hideItems()" width="200" border="1"&gt;
    &lt;tr&gt;
      &lt;td class="class1"&gt;1&lt;/td&gt;
      &lt;td class="class2"&gt;2&lt;/td&gt;
      &lt;td class="class3"&gt;3&lt;/td&gt;
      &lt;td class="class1"&gt;1&lt;/td&gt;
      &lt;td class="class2"&gt;2&lt;/td&gt;
      &lt;td class="class3"&gt;3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class="class3"&gt;3&lt;/td&gt;
      &lt;td class="class1"&gt;1&lt;/td&gt;
      &lt;td class="class2"&gt;2&lt;/td&gt;
      &lt;td class="class3"&gt;3&lt;/td&gt;
      &lt;td class="class1"&gt;1&lt;/td&gt;
      &lt;td class="class2"&gt;2&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>In the end, there's going to be a three checkboxes, displaying the dimensions based on which of the three are selected. That part, I can do just fine, but calling the particular dimensions to become invisible is what I'm having an issue with currently.</p>
  
  <p>Thanks in advance for any kind of help.</p>