Javascript hide/show classes with checkbox
<p>I am just learning javascript, so please bear with me! </p>

<p>I want to be able to use checkboxes to choose to hide/show div classes (to basically filter the amount of info being shown). It is done in <a href="http://www.askthecssguy.com/2009/03/checkbox_filters_with_jquery_1.html" rel="nofollow">this</a>... but I'm try to figure out something much simpler (since I don't need to dynamically generate the checkbox options.)</p>

<p>I came across this example: The Javascript: </p>

<pre><code> function showMe (it, box) { 
   var vis = (box.checked) ? "block" : "none"; 
   document.getElementById(it).style.display = vis;
 } 
</code></pre>

<p>The HTML</p>

<pre><code>&lt;form&gt;
&lt;input type="checkbox" checked="checked" value="value1" onclick="showMe('div1', this)" /&gt;value1
&lt;input type="checkbox" checked="checked" value="value2" onclick="showMe('div2', this)" /&gt;value2
&lt;input type="checkbox" checked="checked" value="value3" onclick="showMe('div3', this)" /&gt;value3
&lt;/form&gt;

&lt;div id="div1" style="display:block"&gt;Show Div 1&lt;/div&gt;
&lt;div id="div2" style="display:block"&gt;Show Div 2&lt;/div&gt;
&lt;div id="div3" style="display:block"&gt;Show Div 3&lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>But it only works for div ids, not classes. Any idea on how I can work this?</p>

<p>Thanks in advance if you can help me out!</p>
