title: Use checkbox in switch statement
body: <p>I'm creating a site where I want different divs to appear depending on the combination of checkboxes checked. I need to know how to refer to the class of the checkboxs in a switch statement. Here's what I have so far. Any suggestions on how I can make it work? </p>
  
  <p>I'm trying to use "class" to refer to the class of the checkboxes. For example, if I click on checkbox3, and checkbox1 is already clicked, I want div2 to appear. If checkbox1 was not clicked, I want div4 to appear. </p>
  
  <pre><code>$ (".checkbox3").click(function(){    
   switch ($('input:checkbox:checked').attr('class')) {
    case ".checkbox1" &amp;&amp; ".checkbox2":
      $(".div1").fadeIn("slow");
      break;
    case ".checkbox1":
      $(".div2").fadeIn("slow");
      break;
    case ".checkbox2":
      $(".div3").fadeIn("slow");
      break;
    default:
      $(".div4").fadeIn("slow");
      break;
      }
      }); 
  </code></pre>
  
  <p>Here's the HTML code it's refering to. </p>
  
  <pre><code>&lt;form&gt;
   &lt;input type="checkbox" id="redcheck" class="checkbox1"&gt;
   &lt;input type="checkbox" id="greencheck" class="checkbox2"&gt;
   &lt;input type="checkbox" id="bluecheck" class="checkbox3"&gt;
  &lt;/form&gt; 
  &lt;div class="div1"&gt;&lt;/div&gt;
  &lt;div class="div2"&gt;&lt;/div&gt;
  &lt;div class="div3"&gt;&lt;/div&gt;
  &lt;div class="div4"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Any help would be really helpful! Thanks!</p>