title: Using jQuery checking if multiple checkboxes are checked?
body: <p>Hello I'm wondering if it's possible to use jQuery to check if checkboxes are checked in a smart way, let's say that we use a switch case with a bunch of input fields, as an example I got 5 checkboxes.
  Company, name, username, age, password.
  And if you check Company, I can run my code. </p>
  
  <p>I want to do this in the smartest way as possible in jQuery, let's say I want something like this in pseudo</p>
  
  <pre><code>switch(checkboxarray?) {
  
      case Company: 
      document.write("Company: INPUT FIELD");
      break;
  
  }
  </code></pre>
  
  <p>I've looked into this but I've only found solutions that provide a function for one checkbox</p>
  
  <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;  
  $(document).ready(function() {
      $('#messageVisibilityCheckbox').change(
          function () {
              if ($('#messageVisibilityCheckbox').is(':checked')) {
                  alert('is checked'); //document.write("Company: INPUT FIELD);
              }  
              else {
  
              }
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>and the HTML: </p>
  
  <pre><code>sinput type="checkbox" id="messageVisibilityCheckbox" name="messageVisibilityCheckbox"/&gt;
  </code></pre>
  
  <p>so instead of creating a bunch of functions, I want to create one function with a switch case or something equal were I can just add a few lines for each checkbox.
  The reason why I need this is because I'll have like 30 checkboxes and half of them requires an extra input field, any help or source is highly appreciated! Thanks!</p>