title: Hide and show multiple divs with one click
body: <p>I'm trying to hide and show two divs with one click.</p>
  
  <pre><code>&lt;a href="javascript:showhide('bbb','ccc4')"&gt;
      you click here to see two div contents &lt;/a&gt;sddsds&lt;br /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I have been able to only hide and show one div. When I try to hide and show two divs, using ID, I can't. I've tried some other suggestions, but they do not work. </p>
  
  <pre><code>&lt;a href="javascript:showhide('bbb','ccc4')"&gt;
      you click here to see two div contents &lt;/a&gt;sddsds&lt;br /&gt;
  &lt;/a&gt;
  
  &lt;div target='ccc4' name='ccc4'  id='ccc4' frameborder='0'onload='setIframeHeight(this.id)'   style='display:none;'  ' &gt; ddfddddd
  
      &lt;iframe class='shark'  src='imagehugeblow.php?midd=&lt;?=$row5['mid'] ?&gt;ccc' target='ccc' name='ccc'  id='ccc' frameborder='0'onload='setIframeHeight(this.id)'     style='display:none;'              &gt;&lt;/iframe&gt;
  
  &lt;/div&gt; &lt;div target='bbb' name='bbb'  id='bbb' frameborder='0'onload='setIframeHeight(this.id)'   style='display:none;'  ' &gt; sdds
  
      &lt;iframe class='shark'  src='imagehugeblow.php?midd=&lt;?=$row5['mid'] ?&gt;ccc' target='bbb' name='bbb'  id='bbb' frameborder='0'onload='setIframeHeight(this.id)'     style='display:none;'              &gt;&lt;/iframe&gt;
  
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
    function showhide(id) {
      var e = document.getElementById(id);
      e.style.display = (e.style.display == 'block') ? 'none' : 'block';
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>I've tried using the Javascript below, but it doesn't work either.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function toggle_visibility() {
          for (var i = 0, len = arguments.length; i &lt; e; i++) {
              var e = document.getElementById(arguments[i]).style,d = e.display;
              e.display = (d == "block") ? "none" : "block";
          }
      } 
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there a way to hide more than one div with one click, or must I use class instead of using ID?</p>